First, I just want to point out that I don't know a lot about cars so if say something stupid

, but I love BMWs and had a very similiar experience getting mine:
I found a manual 1992 325i with 167,000 miles on it. It was in at a repair shop (
http://www.benkempner.com/car/ if you want to see) and I wanted it as soon as i saw it - but there was a catch.
The kid came into the shop with it billowing smoke out the back, so first they thought it was the radiator and replaced that - then before taking it out on the street they discovered it actually had a blown gasket. It was risky for me to repair the gasket because the radiator issue suggests he was really riding this thing by the time he brought it in and I was worried he cracked the block in the process - but I couldn't find out if he had until they ripped the engine apart to fix the gasket.
So I decided to shop around and found a 1993 (vanos) automatic engine with 80,000 miles on it for $1300 (Cherry Auto or something like that I can find the link if your really interested). I called around to a couple shops and got a bid for $800 - $1000 to swap it in for the new engine.
I called the kid and offered him $2800 for the car, then I figured it would cost me $2300 for the engine swap and I would have a sweet 325i for $5100 total.
To make an already long story shorter this was not a simple process. The harnesses weren't compatible, the valve cover had a tiny hole in it, the ECU kept fucking up, the o2 sensor kept fucking up, it wasn't pretty. In the end it cost $2500 for the swap and it took 2 months. Part of the reason is because I got so fed up with the first mechanic went off on him and took my car to another shop.
I never had to change the tranny at all and the engine runs pretty good now it has a lot of pep but it does some wierd things like when I'm in high RPMs and let off the gas when it drops below 2.5k the exhaust sounds irregular (not sure how to describe it - it just doesn't sound like it is smothly reving down it kinds of jumps around like a boxer engine.. sorta)
I love the car though its very fast and looks great so overall I'm happy but it was a pain in the ass. Paying $6600 for the car is a little overpriced in my opinion though - especially when your planning on paying $5100.

ghead
If your going to do it might as well go for the m3 because A.) its much better and B.) your going to be emptying your pockets anyways.