The S54 and M54 used different fuel injection (engine control) systems. I suspect this would be a monumental task. The NSA (U.S. National Security Agency) might be able to do it. They have some amazing hackers working there. But, I'd bet you'd end up with thousands of dollars in parts and a broken BMW in your garage. BMW doesn't give up the necessary documentation. DINAN and other tuners have to hack their way around BMW's compiled software code.
I've driven SMG II cars (E46 M3, E60 5 Series). They're nothing to write home about. They behave pretty much like a conventional automatic, except without the advantage of torque multiplication of a torque converter.