If you are holding the joystick against the limit, then what code allows the motor to 'reverse' when it hist the switch? Don't let it do that, just make it so the motor won't see a PWM value on the "too far" side of 127.
Pseudo Pseudocode:
Code:
Do Tank Drive
While (Limit_Switch_Too_Far_Up=1)
If Motor Input < 127, then Motor Input = 127
End While
Don