GPIO output Hardware Bypass for Modep Patchbox OS

Long story short: I want to add a hardware bypass to my Patchbox Pedalboard box. I thought about using a relay and a basic script to listen to MIDI input to toggle said relay. Before implementing and troubleshooting this tho, I’d like to ask if modep has a function integrated already to do so. Like some way to send GPIO signals when a plugin is a certain state?

Some pseudo code:

if MIDI_Input == Bypass_Switch:
relay_state=bypass

if all_plugins_state == off:
relay_state=bypass

if one_atleast1_plugin_state == on:
relay_state=bypass