Check your engine wiring harness. My 93 400E was exhibiting the exact same symptoms and when I inspected the wiring harness I could not believe the engine would even run -many wires had 4-5 inch lengths of insulation totaly gone.
A new harness totally solved my idle problem. The car now idles at 550 RPM smooth as a V8 should.
A properly running M119 engine is a joy to behold - very strong power at any RPM and 22-24 MPG on the road. Who could ask for more?