A hunting or surging E36 idle usually comes down to unmetered air or a dirty idle-control valve.
The ICV is a DME-controlled rotary valve that meters bypass air; oil-vapour sludge sticks the rotor and gives a hunting, surging or high idle, or stalling
…