Did you check the two idle signal switches for proper operation - the microswitch on the linkage and the throttle position sensor on the butterfly valve (buried under the air flow sensor housing)?
The latter has a three pin connector on about a six inch pigtail, with the connector easily accessible in a harness channel above the inlet manifold. One circuit is ground, one should show continuity at idle, and the other at WOT. If this switch does not show continuity between two of the pins with the throttle pedal in the idle positon, the engine will not idle properly because the ECU is not receiving the proper idle signal.
About a year ago when my idle behavior went haywire, I found that the TPS was not giving the idle signal and solved the problem with a thorough maintenance of the throttle linkage -took it partially apart, cleaned, lubricated, and adjusted. Mercedes calls for lubricating the linkage with some specific hydraulic oil with every oil change. I did this, but gave the visible roller joints a quick shot of WD-40 in lieu of their esoteric lubricant recommendation. The ball and socket joints further down are virtually impossible to lubricate without taking them apart, so time and dirt take their toll on them and eventually the linkage misbehaves.
Mercedes deserves a lifetime "Rube Goldberg" award for taking a function as simple as throttle valve control and designing as complicated a linkage as could be imagined to control it. I thought the bellcrank on an old FI Sting Ray was a PIA, but Mercedes takes the cake!