I've just done the same on a '96 328 coupe. Drill out rivets and remove motor and gearbox from mechanism. A new motor cost me £120.00 inc vat from BMW (ouch!). Before assembly, connect the motor and run it all the way "down" until it stops. Then assemble with the rack mechanism all the way down too. (I guess you could do it with both in the "up" position) I didn't at first and wondered why it only moved a tiny bit in one direction. It seems the motor knows where it is so to speak.
Best of luck