your best bet and basically only option is to buy an E34 525iX as you will need the M50 sump with the front diff etc. you will then need to modify the E30 subfram to accept the engine as the bottom of the sump is lower to accomodate the diff. if your lucky the geometry of the front axels will line up otherwise your screwed.
all in all, some projects not worth tackling, this one might be a bit far. get an E34 525iX and put your S50 in that instead.