For reference, I swapped a S54 into my E30 M3. The S54 is a cheaper, easier to modify and newer engine than the S38, so unless there is just a love for the S38, S54 is the way to go. You can bolt up an E36 M3 5 speed directly to the S54 and its lighter, no modification of any kind. For the DME, there are a number of places that will reflash it for 1k or less. The S54 itself is pretty pricey now as the swaps have gotten easier, but you can easily find a motor on Ebay even. Arc Asylum sells an oil pan that allows the S54 to fit an E30 that may also work on an E9. If you have any specific questions, send me a message.