I have been going down this rabbit hole myself lately since my M30 decided to get all smoky on me, and the performance has always been 'underwhelming'. I'll put it this way, I was dusted by an '83 US 633 auto. So, something is clearly off with my setup.
As a result, I've been looking carefully at four options:
0. Fix the existing setup
1. Warm over the M30
2. Install a S38
3. Install a S54
For option 0, I've had the car in with a few different shops that specialize in 80s german cars, and most of them haven't found anything with the engine setup. I ended up fixing more by careful observation and fiddling. Replaced the spark plug wiring (torn boot), adjusted the TPS sensor, checking plugs, etc. without putting it on the dyno, I don't know if this is as good as it gets, as I've never driven any other M30 car to know if it's 'right'. I do know it's running better than it has in a very long time. Then it decided to start smoking on me. </table flip>
For option 1, the M30 (NA) seems to be limited by the head design, as even a base S38B35 outperforms a heavily modified M30 on dynos. Ergo FI is the way to go. Parts are rapidly becoming NLA. (like oil pumps, coolant hoses, FI components and sensors, etc.) A warmed over NA M30B35 seems to top out around ~200-230 rwhp (cams, 10:1, porting, MS, headers, etc.) and costs around 10k, to say nothing of install. So, total, we're talking about 15k. Turbocharging, end to end, would likely be in the 10k range for a kit + install, and yield ~300 rwhp.
For option 2, there's quite a bit of work involved, with very expensive parts. The going rate for a S38 seems to be 10k+ for just a used, dressed, long block right now. After that there's all the usual swap stuff to worry about, like oil pan, front subframe, thermostat housing, brake booster clearance, firewall modifications, etc. Also parts are rapidly becoming NLA and are dreadfully expensive. On the plus side, the stock M30 transmissions will work. Total is probably in the 20-30k range, and will make ~260-320 rwhp depending on S38 version and if it is improved prior to install.
For option 3, I also looked into Jeff, Castro, and spoke with the seller on Stan's E9. They went to Castro to actually get it working properly. Castro verbally quoted me ~25-40k to convert to a S54, depending on the work on the S54 prior to install. As others have said, this is substantially more radical because there's subframe work to clear the hood. That opens up huge cans of worms since now we're talking about suspension and steering redesigns as well. S54s seem to end up around 300 rwhp without other work. Cams + head work get to ~340 rwhp.
So, now we're all looking at multiple seriously expensive options. Based on the M30 Motronic phase out (~25 years) and the S54's last build date, I estimate we have ~10-12 years of good parts availability remaining for the S54. The S38 is already on the way out the door, as can be seen by trying to find good MAF/ICV/TPS etc for something less than a king's ransom. Most of the M30 and S38 FI system components are very mechanical in nature and don't have a lot of integrated circuits. This means dedicated aftermarket systems / sensors can be adapted and implemented. (Like Megasquirt!) The S54, on the other hand, is fully IC'd, so long-term support will be challenging.
If the goal is to setup the car for long-term use and serviceability, while heating it up a bit, I see 3 ways to go about this: update it as BMW drops things, bite the bullet and go aftermarket for the FI system, or keep the car as original as possible. Going aftermarket can be great (just as sfdon!) but it also opens up issues with someone new supporting the car, as the only person that actually knows how to maintain it is the owner, because they are the only one that knows what it truly 'is' at the moment. Updating the car with new BMW powertrains causes the same problem. None of the original parts will suddenly work, then you're referencing 10 different tabs on realoem to figure out which hose should work. Keeping the car original eliminates this uncertainty, but then you're at the whim of BMW to keep making parts for a 50+ year old car.
I have no idea which option is best, but I would love to hear if others have different ideas.