Can GPIO events be used as automation triggers?

I am new to home automation and microprocessors. I am just beginning to work through Home Assistant and should receive my hardware tomorrow. However, I am designing a digital control system for my greenhouse and need some direction for an obscure point. I am planning to use Shelly devices to control many operations. There is one that I haven’t found support for. I have a passive vent system that I need to open and close based on temperature. In my previous analog control system I used limit switches to control the max open and close vent positions. I haven’t found an easy way to do that with my RPi and Home Assistant and associated hardware. I was thinking that I could tie GPIO pin N to the open limit switch common terminal, then tie the open limit switch NO terminal to GPIO pin N+1 (or whatever). That way I could raise GPIO pin N when starting to open the vent and GPIO pin N+1 would go high when the limit switch is hit. This uses the 3.3v from GPIO pin N to raise GPIO pin N+1. So, first, can an automation access the GPIO pins, both to raise them or as a trigger? Second, is this a really stupid approach and is there a much easier way to do this? The problem is that the physical vent movement needs to be accurate, repeatable and reliable, especially closing in the winter and I am leary of using a button, though the action is the same. As extra credit, I would like to set a timeout so that if the open/close operation doesn’t complete in some time period that I can stop the process and send a failure notification. TIA!

Instead of trying to use the GPIO on your RPi directly, take a look at the ESP-Home integration with HA. It allows you to use cheap, wifi microcontrollers (ESP8266 and ESP32) to integrate into HA. The boards can be found everywhere online and offer a wire range of sizes and form factors and number of available GPIO.
Also, did you know that your Shelly devices actually operate based on ESP microcontrollers? You can actually flash them with ESP-Home to make control in HA completely local.