You may want to check your mass air flow sensor too. I had an erratic idle problem with my 94E320 before. I replaced the spark plugs and boots. cleaned the egr tube, replaced the fuel pump relay and check valve. The problem didn't go away. Since the mass air flow sensor is expensive around $250.00, I repalced it last. The problem went away.
94 E320 Silver 210000 miles
94 740il Pewter Green 97000 miles- Retired
05 S430 4Matic
07 Lexus IS250