BMW Repair: suddenly, engine cuts out above 2400 RPM..., bmw 318ti, obd ii


Question
Hi!  I sure hope you can help.  I am far from home, and need advice on what may be wrong with my car.  
First, it is a '96 BMW 318ti, with the M44 4-cyl engine and OBD II. The car has 136,000 miles. and has run flawlessly since I got it a few years ago (with 76,000 on the odometer).
I am visiting, and the car won't let me get home.  After driving on the highway for the 320 miles here, it was started once the next day to move it off the driveway onto the grass -- that went fine.  The weather turned rainy, and two days later, when I started it to leave for home, it wouldn't start immediately -- cranked and cranked, but didn't start.  Eventually, it began to show signs, so I let it rest a minute and tried again.  It started, but was "flooded", if injected engines still flood, so it ran roughly for the first half minute or so, then smoothed out.  The "Check Engine" light came on and stayed on.
Trouble was, when I revved it up to about 1800 RPM, the engine cut out until the revs dropped a hundred or so RPM, then caught again, repeatedly.  I let it warm up a little, and shut it off in case the plug wires were damp/cracked, and drying might help.  Two hours later, it started right up, but still cut out at 1800.  I drove it around the neighborhood, but as it warmed up, the engine started to cut out at lower RPMs, down to about 1500 by the time I got back.
I stayed the night.
This morning, it started right up, no hesitation at all, and revved past 1800, past 2500, and beyond, so I let it warm up a bit before a test ride.  I thought I was all set until it got to around 3300 RPM, when it cut out again!  I drove around the block and returned, let it run longer, and it started cutting out at lower speeds again, eventually at around 2400 RPM when I gave up.
It seems fine until that cut-out point: smooth as ever, which makes me doubt it could be cracked plug wires, but I don't know. They look fine.  The "Check Engine" light is still on, and flickers a little bit when the engine is sputtering.  I'm thinking fuel pump.  The fuse is OK, I think, as the filament is intact.  New fuel filter last summer.  Plugs a few years old, but Bosch platinum, should be OK.
HELP!
Thanks,
Dean


Answer
was it raining heavily? with those cars, a lot of times water would work its way into the E-BOX, where the engine and transmission control units are located. The E-BOX is on the passenger side under the hood and sometimes when it rains heavy, the water can't drain fast enough and runs into the E-BOX and damages the control units which can cause funky situations. You have a check engine light on so I suggest you bring it to be checked. You don't want to risk travelling long distance and get stranded. It could just simply be a sensor gone bad, but it needs to be checked