The procedure described below is for a 911SC, but other models are similar.
The first step in repairing or replacing the window regulator is to remove the door panel. That is covered in a separate technical article on this site.
After the door panel is removed:
1. Lower the window slightly more than halfway, and tape it in position.
2. Remove the two allen-head screws holding the rear end of the regulator, and the four allen-head screws holding the other end, where the motor and gear mechanism is located.
3. Detach the two wires from the motor, noting which is connected to which terminal, and how the wiring is routed through the motor bracket.
4. Manipulate the entire regulator/motor mechanism to remove the white plastic rollers from the tracks attached to the bottom of the window. (It may be necessary to move the window up or down to do this.)
5. Unbolt the motor from the regulator by removing three 10mm cap screws, and remove it from the door.
6. Remove the regulator from the door. This may take a little fidgeting, as it is a tight fit, but it will come out without forcing.
7. The regulator and motor can now be inspected and tested. In my case, the loose part was the anchor stud for the regulator spring. It is merely swaged into place, and it can be reattached easily by peening.
8. When the regulator is reassembled with the spring properly tensioned, it will be roughly L-shaped (impossible to put back inside the door without removing the window channel). Pull the spring-loaded arm down until it is aligned with the rest of the mechanism, and tie it in that position with a cable tie. Test fit the motor to ensure that it aligns with the mounting bolt holes and the regulator gear teeth.
9. The regulator can now be inserted into the door (without removing the window channel or glass).
10. Bolt the motor onto the regulator. After ensuring that the gears mesh, cut the cable tie.
11. Reinsert the rollers into the window track.
12. Reinstall the allen-head screws and reattach the motor wiring.
13. Test operation and reinstall the door panel.