S!
Depending on if you have the S38B36 or S38B38 engine check the function of the resonance flap. It has an effect on acceleration. The B36 makes the test upon starting, with B38 you need to rev the engine 4k+ rpm or put a small dot of grease on the stopper and take a faster drive to see if the actuator has moved and touched the grease. If it does not work then vacuum hoses need a thorough inspection, look at the Resonance Flap thread for example, has good tips and even parts numbers you might require. BMW is picky about the vacuum system from what I have noticed.
Then check all the venting tubes for the oil system, there are 3 coming to the plenum. 2 thicker and 1 thinner, connecting to or near the or separation bowl under the plenum. If you have the plenum removed, check the idle motor and it's tubes as well. Clean the idle motor well as it can be soothy thus causing rough idle.
The normal checks are of course air filter, spark plugs, fuel filter etc. MAF can be inspected if it is dirty and the rubber tube going from MAF to Plenum if it has cracks in it, with age they can get a bit brittle.
I would start with these checks and sure that the more experienced gurus here will chime in as well

They know their stuff