I'm with jarance, been xperianced it, found a few cracks on the vacuum hose aka the air filter hose. fixed it with silicon adhesive glue, solved the problem. Got extra money then have to change new
Good Luck with it.
idling problem
check your air flow meter and icv. i kena before mine afm the valve stuck due to years of dust build up, i've opened and cleaned it with fine polishing paper don't forget to apply silicone to seal. for the icv it also might suffer years of carbon build up- soak it in petrol/benzene and clean it ,
Check your vacuum hoses and Crankcase Breather Valve. I changed these for my ride. Now, everything has gone back to normal. Don't forget to clean your overall intake system.
Sounds like your AFM...the next time ur engine dies on you, remove the AFM and check if the flap pop's back if u poke it a few times with a screw driver..but if tht fails, do as Mont-O said..."just ketuk ketuk the unit then it's will okay"....tht works fine also... good luck!