In the OctoPrint Settings, GCODE Scripts, After serial connection... and Before serial connection you can add the GCODE commands you created with the plugin.
I'll leave the writing of system commands to toggle a GPIO pin as an exercise for the OP.
thank you
system commands to toggle a GPIO pin on was ( gpio -g write 24 1)
the 24 being the gpio pin and the 1 for on off is the same but 0 at the end.
thanks
martin