Same idea but a switch: https://hackaday.io/project/179539-hardware-boot-selection-s...
I had something like that hanging off a parallel port in a PC in 1990; it read the status bits of a printer port and booted accordingly. Could still do it today, via a $1 USB serial port's status bits.
pin 0 on = normal boot, pin 0 off = single user mode.
pin 1 on = GRUB interactive screen enabled, pin 1 off = GRUB interactive screen disabled.