I have done this swap and can probably help you navigate some of the obstacles that you'll encounter. For my project, I started with a 2003 330i sedan. I pulled the engine and transmission myself, originally with the intention of reinstalling the M54 engine with enhancements that I estimated would yield an extra 20-30 HP. That was a first for me with a BMW (my only prior engine removal and rebuilding experience was with a 1969 VW bus). That was so much work (made more difficult, I eventually learned, by broken engine mounts) that by the time I completed that first stage, I was easily persuaded to drop the idea of putting the M54 engine back in ("Are you crazy!? After going through all of that, you're going to reinstall the same engine?").
And so, a simple 330i sedan enhancement project morphed into a S54 engine swap. And once I accepted that line of thinking, the project soon snowballed from there into a complete M3 conversion. At that point, aware that I lacked the level of experience necessary to finish a project like this (in a reasonable amount of time), I took the 330i chassis to professionals to complete the transformation: Premier Restorations in Clifton, NJ for bodywork, paint, and interior; and Autocouture Motoring in Fair Lawn, NJ for everything mechanical. The mechanic assigned to my project took notes, as needed, regarding every issue encountered that was not just a straightforward swap. I think I am aware of most of the bigger issues, at least in general terms; where specific details are needed, I might be well enough informed to point you in the right direction to find the information you need.
Of course, other members on this forum with more knowledge and experience than I are available and willing to help. One issue in particular that you'll have to grapple with are pinout changes that are required to make a M3 MSS54 DME (ECU) work with your 330i wiring harness. Of course, an S54 engine wiring harness was installed, but this swap alone - along with the ECU swap - will not suffice. There will be still be issues related to differing pin assignments in the 330i and M3 chassis. Without these changes, the engine will not even start. Autocouture Motoring consulted an outside specialist (Kassel Performance, in York, PA) to sort out this problem. Good luck with your project if you decide to take the plunge!
My car received a complete color change and several enhancements (bodywork, interior, and mechanical), and the project is now two years in gestation. It is at a detailer now getting finishing touches. But soon it will be ready, at which point I will post more extensively about this experience.
P.S. I would like to post images, but I am baffled by the pop-up window that asks for the URL for the image. Can someone help, please? My photos are stored on an internal drive, but not on any webpage. How do you post photos to this forum?