Check the temp sensor as Ian stated. The one for the ECU is at the back on the engine on the right hand side. The wires going to the two connectors can crack and break causing all sorts of problems. I have had to replace them on 3 of my MB and my 300SE has had them replaced in the past too.
Also check the pins on the OVP plug as they cam become loose over the years. I have also been having running problems and found all the pins to be quite loose.
You have to dismantle the plug to release the idividual pins and then gently crimp them to close the gap.
My car instantly ran better and smoother and so far hasn't cut out(touches wood)