Sounds like you have a vaccum leak that is causing your engine to 'run on' (the correct term) after you turn it off. The engine uses the remaining fuel in the inlet tract which is not usually enough to give a full power stroke. (A bit like a gun misfire and jam) The engine runs backwards briefly and lets a part firing compression back into the inlet manifold. Does it start to come clear? BTW when cars had carbies they could run on for 15 seconds or more. Good for damage as NO oil pressure. Fix the vac leaks and go from there.
Good - Fast - Cheap: Pick any two.
E23 735i; E30 318i; E32 735iL (X 2 - 1 White and 1 Light Blue); E34 535i; E38 735iL; R50 Cooper; R55 Cooper Clubman.
E21 318i; E32 735iL; E34 535i; E38 730iL; E53 4.4i