Thank you for posting your code. I noticed that you used a BEGIN/REPEAT block in your
sequence_b subroutine. This means that the script never returned to the main loop in the code. Also, your
frame subroutine was waiting for another button push.
You should be able to do what you described by using the GET_POSITION command to check the current target position being sent to the servo, and send it to the other position instead. For example,
sequence_b could check what position servo channel 3 is at, and if it equals 5000, set the new target position to 4000. If it does not equal 5000, set the new position to 5000. If you did that, your new
sequence_b subroutine would look something like this:
3 get_position #see what position the servo is in
5000 equals if #if it is at position 5000
4000 3 servo #set it to position 4000
5000 3 servo #otherwise, set it to 5000
500 delay #small delay
If you try making that modification and it does not work for you, can you post your updated code as well as a description of what it does and what you want to happen instead?