QuoteCheck if joint 1 position not equal 0, set PR[100,1] equal to the current J1 position.
This is incorrect. The code is checking the argument (X), not the J1 position. So to use your example, SAFE(0) will move the robot to joint position (Joint 1 current value, -30,0,0,-75,-30) while SAFE(60) will move the robot to (60,-30,0,0,-75,-30)