It's not the motor. The motor is just an electro-hydraulic unit that just pumps hydraulic fluid.
The simplest is that the top is binding somewhere close to the end of it's travel and releases quickly. Try lubricating all the joints.
As for a mechanical failure....
It could be the Gas Pressurized springs, no. 13
http://www.realoem.com/bmw/showparts...12&hg=54&fg=10
or one of the tensioning ropes, no. 5 or 7
http://www.realoem.com/bmw/showparts...11&hg=54&fg=10