Idle and Performance Problems
Idle Control Valve
These get gunged up after time with oil and dust and therefore will not operate correctly. It is possible to clean this with brake cleaner or a similar solvent (soak overnight). If you want to be 100% sure you can purchase them new from BMW although at £165 not a cheap part.
Coolant Temperature Sensor
If this sensor fails it can give the ecu incorrect information. eg: If the ecu receives the message that the engine is cold more fuel than is required may be given to the engine upsetting the idle.
Throttle Position Switch
This switch is very venerable to failure. It should be replace on every inspection 2 service. These are an important part for the idle to function correctly. The contacts on this switch are gold plated this shows the importance to its operation. The new from BMW is about £40..
Air Leaks
The M3 does not like air leaks at all, as do no engines, but the M3 suffers as a result more than most if it gets an air leak. Check all hoses to and from the ICV. Leaks can also be coming from the joints where the air-box trumpets meet the throttle bodies. These trumpets have o-ring sealing them which can perish. Another failing is the small rubber pipes which cover the short brass pipe above each throttle body. These can split and can effect the idling immensely.
Vanos Ecu
If the Vanos ecu fails this will give false or no reading to the main ecu. This will then cause incorrect movement of the cams. in most cases when the Vanos ecu fails the cams are permanently in the advanced position, so again really making the idle bad...(seems to be firing on 5 cylinders). With this failure the low down power is very very poor, so is fuel economy.
Seal on the Solenoid Valve inside the Vanos
Can also cause rough idle when cold but the idle will be ok when warm.