Just off the top of my head, changing the 2.8 with another engine would require you to change the ECU and exhaust system & cooling system.
If you went to a 3.5 you would also have to change the transmission, & drive shaft. Nothing on the car but the body was made for an M. On the M the schocks, entire braking system, bushings, cooling system.
If you know what you are doing and have experience working with BMWs one can do allot. But BMW's build cars based upon the horse power. More HP bigger cooling system, brakeing system, suspensions. etc. Every BMW is the same and they are all different.
Before I made such a venture about Launch X431 Diagun
I would do allot of research, matching part numbers up would be a start.
I would put the 2.8l back in and be driving rather than spending the xtra money & time to modify it.