My 87 EA82 3AT wagon began doing odd things a while back. Occasionally, when idling, the engine would rev for a fraction of a second. Once in a while, when cold starting, it would fire initially, and die. Cranking with the pedal half way down or so would get it to re fire, and run rough for a few seconds, then be normal.
These things began roughly around the same time, and fairly infrequently, like once per week, so trouble shooting would have been near impossible.
As I expected, the frequency of these occurrences increased. The last few days, the idle would almost always be 1000 -1500RPM.
So I put an ohm meter on the thermometer - the temperature sensor that the ECU uses, not the one for the temperature gauge. The sensor in question is on the lower part of the thermostat housing, toward the front of the engine. It has 2 wires connecting it to the harness.
And it read jumpy numbers in the low thousands of ohms, from when the engine was hot, all the way down to room temp.
Put in another sensor, poof! Works fine now.
Posted on the chance that someone may have the same mysterious trouble someday.