Hi Mike
Could be that you have a faulty Idle Control Valve or Crankshaft Pulse Sensor. Neither part is particularly expensive but are difficult to check if you don't have access to certain tools (i.e. ohhmmeter). One check for the Idle COntrol Valve (this is a T or L shaped valve running inline between the air box and the injection manifold) is to disconnect the electonic connector from it. This is held in place by a metal clip. The engine must be at running temp (about 60c) with all electrics turned off (auxillary cooling fan, heater, lights etc.). With the engine running disconnect the connector, the revs should jump up to about 2000rpm, if they dont the vavle is probably faulty. If you aren't happy doing this take the car to a BMW garage and they will put it on a diagnostics machine for about 50 quid.