Howdy,
What year is the car? The OM603 six-cylinder in the '86 and '87 have an idle speed control system and an "anti-jerk" solenoid that helps with idle smoothness.
The five-cylinder OM617 in the earlier cars will become rough and idle poorly due to injectors getting old or dirty (among other reasons).
Checking for air leaks in the fuel system and doing a compression test is a great place to start...