rbayer is really the authority on this one, but this is my thought. (I havn't used pbasic much and cannot test this threory from where I'm at)
Code:
If 117 < p1_y & p1_y < 137 THEN stop_p1_y
If 117 < p3_y & p1_y < 137 THEN stop_p3_y
goto end_zero
Having the checking seperated may be your problem.