Whether a bad trans modulator affects the idle quality can be easily diagnosed by plugging the vacuum line that feeds the modulator. Cap off the vacuum line....if idle improves, you've found your problem.
There are a number of ways to find vacuum leaks. One is to spray a solvent such as carb cleaner on suspect areas. If idle goes up when you hit a certain area, you've found your leak. Another is to flow propane gas over suspect areas. This method is recommended with the obvious disclaimer of its inherent danger, should you have a stray spark under the hood.
95 E320 Cabriolet, 131K