Since you did not mention you hear grinding noises and the like, I figured your motor is running but the cable is not moving. There is a clutch in the drive system intended to allow the motor to turn after the sunroof panel reaches its end of travel in the open and close direction. If your system is not internally broken, you may just need to adjust the clutch.
I read some additional stuff in the manual and it may help for you to measure the torque output of the clutch/motor system by putting a torque wrench on the emergency manual activation nut in the trunk (plastic 16 mm nut) and have someone else try the motor. You should see a nominal torque value of 6 to 7 Nm, which is not a lot. You can adjust the clutch to transmit greater torque, but the manual cautions you not to over tighten it so it locks up. A good cleaning and lubrication of the mechanism should also help reduce the torque needed to move the roof panel. After years of operation it is feasible the clutch is wearing a little too, so an adjustment and cleaning may be in order.
The procedure for adjusting the clutch is to take the plastic nut off(it apparently pulls off) and use a wrench to turn the nut that is now uncovered (hold the shaft with an open end wrench of 6mm "in the place provided") clockwise to tighten the clutch. Turn it no more than 60 degrees and then check the the torque again, making sure the clutch releases. Adjust it to restore or even add a little torque to the cable drive and see what results.
Good luck, Jim
1986 Euro 190E 2.3-16 (291,000 miles),
1998 E300D TurboDiesel, 231,000 miles -purchased with 45,000,
1988 300E 5-speed 252,000 miles,
1983 240D 4-speed, purchased w/136,000, now with 222,000 miles.
2009 ML320CDI Bluetec, 89,000 miles
1971 220D (250,000 miles plus, sold to father-in-law),
1975 240D (245,000 miles - died of body rot),
1991 350SD (176,560 miles, weakest Benz I have owned),
1999 C230 Sport (45,400 miles),
1982 240D (321,000 miles, put to sleep)