Check the vacuum advance/retard on the distributor. If the diaphragm is leaking, it can be a big air leak and cause hesitation and rough idle. It sounds like you either have a vacuum leak or a burned /leaking valve on the engine. Have you checked the compression in each cylinder to verify the engine mechanicals are OK?
If the compression readings are all ok, it can still be a worn camshaft lobe, but those do not happen suddenly and is way down the list of things to check.
The EGR and all the other fuel and vacuum system have to be in perfect order for a smooth idle in D. If even a small amount of EGR leaks past the control valve at idle, it will not idle smooth.
I do not know specifically how the EGR gets back into the intake system on your engine, but many MBZ's had it flowing through passages in the cylinder head to each intake valve pocket. If some of those get plugged up, then all the EGR flow goes into the others and really causes bad hesitation and a rough running engine just off idle.