Funny you should mention this, as I found myself in the same boat. Except mine was intermittant, I first thought it was the switch but a short time later with a multi-meter, I discovered is was indeed the motor. After some research, I discovered that the motor guilty of these pesky issues was right above my head. (2013 MKS Eco) Using my past skills in Car Audio (and all the tools needed to do this) I dove in. The headliner was like nothing I have ever seen, quite a few wiring harnessses that were literally hot-glued to it preventing a proper drop. That was the HARDEST thing to overcome, working with a 5 inch gap, at best. The motor came from Rockauto at about $135.
https://www.rockauto.com/en/moreinfo.php?pk=2604228&cc=1503893&pt=1536&jsn=1033It was about a 3 hour job total, keeping in mind that my interior is a light tan and so there was much stopping and cleaning of my hands as I went to prevent staining of the headliner. It was well worth it, the Sunroof works perfectly and much quieter than before.
EDIT: There ARE two motors up there, Drivers side does Slide/Tilt and Passengers side just does the electric sunshade. After you replace the motor, you MUST do a
motor initialization to get the motor to stop at the right points in travel. The steps are a bit convoluted (I had to write them down, I can supply them if
requested)
I think a speaker upgrade will be next............