I'm going to suggest the AFM.
my 200sx did this on occasions.
the cable to the AFM on my car was dodgy and would sometimes cause a temporary bad reading. enough to cause it to drop revs, then back up and sometimes just struggle for 2 seconds then stall.
see if you can force it to happen.
pop the bonnet.
start the car.
then move your afm cable around.
or even move the afm around (if you have a pod filter instead of stock airbox).
in the DIY section of these forums, do a search for "AFM+SOLDER" to find the thread on how to repair a faulty AFM.
also, if you haven't already done so, take the AFM off and spray the inside with electric contact cleaner.
this will clean off any oily shit and dirt that might be there causing the problems.
spray on and it's clean and dry within 20 seconds.
The soldering is also pretty easy..
have a search/read