Switch loops with SPDT switch
There is no need for a SPDT switch. A SPST works just as well.
If you have a SPDT switch with 3 positions (pole 1 closed, open, pole 2 closed) you can use it to activate one pin or the other, or neither.
Let's pretend your switch is an SPST. Ignore one of the poles (pole 2, say.)
Connect a digital pin to pole 1. connect the common (center) pin to ground.
Set your digital pin to INPUT_PULLUP. Now, when the pin is LOW, the switch is closed (mode A). When the pin is HIGH, the switch is open (mode B).