If you can get the seller to tell you exactly what he did to the car, it might be useful to have that info. If not, I would take it to an experienced BMW mechanic (even a dealership if you have to) and have him thoroughly check the engine to see if anything weird is going on. I found this place on Google.
http://www.hanswittlerauto.com/index.cfm As for your engine swap question, an M5 engine might be a little much. Check the swap section of the forum for more info than you'll know what to do with on engine swaps. Also consider the DASC or even the new Metric Mechanic street motor.