At first, when I tried changing the state of switches 3 and 4 when the 5160 was running, BASIC would consistently lock up (keyboard freeze and strange characters on screen).

Then I figured that what was happening was that BASIC was using RAM in either motherboard bank 1, 2 or 3, and consequently, locking up when I disabled those banks.
So, then I had my test start with the 5160 motherboard switches set so that only RAM bank 0 was enabled. In that way, BASIC would use bank 0 and thus switching in and out banks 1, 2 or 3 would not affect BASIC.

Initially, that looked like it was the fix for the lock-ups. However, as I did more and more testing, which included multiple motherboards and doing the test over and over, sometimes lock-ups would be experienced, and sometimes not.
I came to the conclusion that a powered-on 5160 motherboard cannot be expected to tolerate banks 1/2/3 being switched in and out.