Staying in a subroutine

By this snippet, I infer that you have a bistable switch, in addition to the pushbutton on the rotary encoder, is that correct? If you were referring to the pushbutton that comes with the encoder, that's a temporary switch, which stays closed only as long as you keep it pressed.