I had a similar problem in which the car would idle irratically but would drive if i was giving it gas but if i took it out of gear and let off the gas it would die. I had just replaced fuel lines on the car and I went trying to find out what the hell i did. I accidently hit a vacuum hose that enters the air ducting between the MAF and throttle body, but thats on my M50, im guessing you have a M20 or M30 because of the distributor, but check all of your vacuum lines, and make sure no air is entering the intake between the air sensor and the engine, causes a false reading in the ecu. Hope this helps.