You didn't say what year your car is -- early models have, I think, KE Jetronic, later ones LH Jetronic injection, and the problems will be different.
If you have KE Jetronic (with a fuel distributor and no air flow sensor) check the idle control valve and associated hoses -- with age, the hoses leak, so dirt gets into the idle control vavle, making it stick closed as you lift off the gas, then fail to open at all as you stop, so it stalls. Loose hoses will cause erratic idle and mixture control problems, so you get surges and stalls from that, too.
The OVP relay can also start dropping voltage to the control circuit, causing the mixture to wander and the ignition to cut in and out.
LH Jetronic will give you fits if the hose between the air flow senor and the throttle valve is leaking, as it won't "see" the idle air and will shut the fuel off, causing an overlean condition, and the O2 sensor circuit can cause surges as the mixture goes out.
1972 220D ?? miles
1988 300E 200,012
1987 300D Turbo killed 9/25/07, 275,000 miles
1985 Volvo 740 GLE Turobodiesel 218,000
1972 280 SE 4.5 165, 000 - It runs!