This sounds like a classic VANOS seals problem. Had this exact issue on my 528iT which has the same engine as your 328 (M52TU). Replaced my old seals which had turned to hard plastic with new Beisan seals and it solved my idle problem, gave me more power thru my normal RPM driving range and improved my fuel economy
read here for more info:
Overall loss of torque and power, particularly in the lower RPM range, < 3k. Bogging then surging at 3k RPM. Uneven power distribution and RPM transition. Engine hesitations in the lower RPM range, < 3k. Louder idle and intermittent idle RPM hiccups. Difficult takeoffs. Loss of power and bogging when AC on. Increased fuel consumption.
Repairing the vanos seals provides:
Overall increase in torque and power, particularly in the lower RPM range, < 3k. Resolution of bogging then surging at 3k RPM. Smooth even distribution of power and RPM transition. Resolution of engine hesitations in the lower RPM range, < 3k. Quiet stable idle. Smooth easy takeoffs. Improved performance when AC on. Reduced fuel consumption, by ~10%.
Cars with the M52TU engine (98/99-00) experience cold weather cold start idle jolts and possible stall.