Video going over issues: http://webm.land/media/8vlo.webm
Started having issues a while ago with some fairly extreme shaking and surging while at idle (including cold starts). To try and resolve this I cleaned my throttle air intake, and got a new air filter. After cleaning the throttle air intake the engine ran what seemed to be perfectly normal for a day with none of the previous issues. I then replaced the air filter and had some issues return (though still improved from before). Cleaned the Mass Air Flow Sensor trying to fix as well (no difference), and tried an idle relearn. Have visually checked for broken tubes and everything for a vacuum leak and didn't see anything.
Starting cool the rpms go to about 1500 and it feels pretty stable. Switching gear drops the rpms to around 900-1100 and makes it pretty rough even if it goes back to park. Turning off AC/lights anything makes it feel smoother.
Starting warm I get the same thing that happened before I cleaned the throttle (before I cleaned it this happened cool as well IIRC). On park it surges from 500-1000 consistently and surges but less so on drive/reverse.
While driving it seems pretty stable and doesn't shake too bad except when stopping. However if I turn off and try to turn my car back on it sometimes fails to do so (starts after waiting 5 minutes or so though) (see failure video for example of this https://webmshare.com/rN9E4 ).
For idle relearn I followed this http://www.subaruforester.org/vbulletin/f113/how-idle-re-learn-after-battery-disconnect-154161/
For the first 10 minutes of idleing it started at 1500 and slowly went down to around 700. (shaking more as it got around 700 but less around 1000)
Second period of idleing was all around 700 shaking badly.
Tried started car again right after and the car failed to start (was a hotter day) https://webmshare.com/rN9E4
The car did work well for a day period (90% sure of this) after cleaning the Throttle Intake so I'm pretty confused.
Before cleaning the Throttle it shook really bad usually right when starting, but if not after driving for 30 seconds, worse then driving after 10 minutes as it is now. So that atleast helped somewhat.
Any ideas of things I can check/try out? Have seen some stuff about the O2 sensor or IACV (what I'm most likely to try next).
Any help would be most appreciated!