@granderjoree There are several scripts that can work like you want

Here is a topic ... in your case use the multi-switch.sh --generic command
https://retropie.org.uk/forum/topic/21992/onoff-latching-switch

Also a good tutorial
https://retropie.org.uk/forum/topic/14537/tutorial-adding-a-dedicated-on-off-switch

or here a combo with reboot and poweroff
https://retropie.org.uk/forum/topic/21932/solved-how-to-make-a-momentary-push-button-that-exit-games-and-take-me-back-to-game-menu