I have (had) the same problem
It started as a very rich cold startup. The mixture was adjusted. Then the car ran great for a few days. One morning I cranked and cranked and cranked and the car wouldn't start. Finally, I figured out that if I cranked and quickly let the key go, the car would fire right up.
The car idled smooth during the warm up period but after reaching operating temp felt like it would die at stop lights. It also surged when stopped in D or R.
The shop replaced the Ignition Control Module (silver box mounted on the drivers side wheel well). This fixed the startup cranking problem but I haven't heard about the idle issue yet. I should hear today and will pass the info on.
The car is a 1985 500SEL.