For starters, the M50 is OBD-1, so good luck getting it to work in the E39.
People have turboed and supercharged M52/S52 engines with fine results. An M52 E36 owner under "Card Counter" on Bimmerforums has over 600 RWHP on his turbo.
No sense in trying to stick with an M50.