The motor and cables are probably stripped out already if making noise. You would need to have it replaced. The vanity covers usually start to fall apart and gets stuck on the track causing the motor to keep spinning but the track is not moving causing the teeth to stripp out. As far as opening by itself these is a first I hear of it doing that on its own? To manually close it you may need to drop down thew headliner and remove the whole cassette to see what is causing it to bind up. Once you move the obstruction remove the motor and push the guides to its closing position and do not plug the motor back up if you do not plan on fixing any time soon so that no one opens the sunroof by accident?