I don't know exactly what you mean by different loops.
Certainly you can use a switch position to signal which of two functions should be used. You should use an IF statement to select because then the ELSE part can be the other function.
And if several functions included an IF test they could all respond differently depending on the switch.
Or you could create a couple of alternative master functions each of which calls several subsidiary functions.
It all depends what you want to achieve.
...R