Had the same problem. $1100 at the dealer and still does it. Finally had a good mechanic at the dealer look at it. It was the distrubutor cap and rotor.
Remove yours and look at it. If it is corroded or pited replace both the rotor and cap.
I had the dealer refund the $1100 for work that was not needed.
1970 220D, owned 1980-1990
1980 240D, owned 1990-1992
1982 300TD, owned 1992-1993
1986 300SDL, owned 1993-2004
1999 E300, owned 1999-2003
1982 300TD, 213,880mi, owned since Nov 18, 1991- Aug 4, 2010 SOLD
1988 560SL, 100,000mi, owned since 1995
1965 Mustang Fastback Mileage Unknown(My sons)
1983 240D, 176,000mi (My daughers) owned since 2004
2007 Honda Accord EX-L I4 auto, the new daily driver
1985 300D 264,000mi Son's new daily driver.(sold)
2008 Hyundai Tiberon. Daughters new car