Check the contacts on the coolant temperature sensor (located at the far end of the engine valve cover with two connection on top). They might be old and loose. Also check the resistance of the coolant temperature sesnor at different temps to make sure it works. Its resistance should be about 6000 ohms at 0 degrees C and abot 300 ohms at 80 degrees C. Also use Fuel Injection cleaner in your tank and then change the fuel filter if you have not already done so.
'86 300E (5-speed)