Removing the entire sunroof to fit a new one will be a bastard of a job.
You're better off getting the parts to fix your current one. I'm guessing it's the guide rails that are broken? If not, then the motor? If the motor, it's a simple swap that won't take you 10 minutes.
The rails will take half a day. You can get them from BMW for around 1600 Mandelas.