UPDATE
After reading weitau's post about his experience with P0011, I decided to replace the AVCS solenoid even though it seemed to work when I tested it with a 9V battery. Before I even took the old one out, I noticed a small crack on an air hose connecting the EGR(?) valve solenoid to the intake (H50382 in the diagram)
https://parts.subaru.com/a/Subaru_2...-CONTROL-EGR-03MY-05MY/S11-081-03.html#H50382
When I touched it, it separated completely (Pic). The tubing lost almost all flexibility, and was rock hard where it broke. I replaced it and went for a drive. The car seemed fine at first, and after a couple of miles I scanned the ECU. It had P0011 pending, and the CEL was off. Then when I came to a stop, the familiar rough idle returned. It wasn't as violent as before, the CEL was still off, and there were no misfire codes, only the pending P0011. So when today the new $20 ebay AVCS solenoid came in, I replaced the old one. I then drove for about 40 miles, with several stops, WOT, and a few minutes of idling. The pending P0011 is gone, and the car idles normally. Although it's only been 40 miles, I'm fairly confident that the AVCS solenoid was the issue. If not, I will add another update to this thread.
After reading weitau's post about his experience with P0011, I decided to replace the AVCS solenoid even though it seemed to work when I tested it with a 9V battery. Before I even took the old one out, I noticed a small crack on an air hose connecting the EGR(?) valve solenoid to the intake (H50382 in the diagram)
https://parts.subaru.com/a/Subaru_2...-CONTROL-EGR-03MY-05MY/S11-081-03.html#H50382
When I touched it, it separated completely (Pic). The tubing lost almost all flexibility, and was rock hard where it broke. I replaced it and went for a drive. The car seemed fine at first, and after a couple of miles I scanned the ECU. It had P0011 pending, and the CEL was off. Then when I came to a stop, the familiar rough idle returned. It wasn't as violent as before, the CEL was still off, and there were no misfire codes, only the pending P0011. So when today the new $20 ebay AVCS solenoid came in, I replaced the old one. I then drove for about 40 miles, with several stops, WOT, and a few minutes of idling. The pending P0011 is gone, and the car idles normally. Although it's only been 40 miles, I'm fairly confident that the AVCS solenoid was the issue. If not, I will add another update to this thread.