I have two grand prixs 04/05 with sunroofs, both had bad sunroof position sensors doing the same thing you described. as far as timing you will need to have sunroof fully closed then remove glass, drop down headliner/sunroof, remove motor/position sensor. New sensor has a pin in it that is set for fully close position. Remove pin after sensor installed.