This sounds like my problem. It'd never happened to me until a few days ago; I have had a funky idle pretty much since I bought it, but it's been getting worse and worse.
As far as I understand it, there is a bad ground somewhere in one of the wire looms by the firewall, just by/behind the injectors/fuel rail.
Try tapping/tugging/shaking this fat group of wires near the firewall; if it affects your idle, it is probably this bad ground. See the following page for possible fix details:
http://www.alldata.com/service_provi.../20000713.html
hope that helps solve your problem!
Edit: it is probably not your distributor or cap; I replaced mine hoping it'd help (also replaced plugs wires fuel filter and air filter at the same time) but to no avail; I still had the fluctuating-and-intermittently-dying-idle issue. This did NOT happen to me when I was just driving/on throttle, only when you let off the throttle and the revs return to idle.