Have you considered a photocell? It's cheaper & simpler, doesn't require programming, and doesn't rely on the accuracy of a clock.
I've used an X-10 system that was supposed to turn lights on/off at sunrise/sunset & sunset. The clock would drift (over several months) and their software had "issues" when combining automatic daylight savings time changes with the sunrise/sunset times. Of course, your
software won't have these issues
but a photocell solves everything.
I would like your ideas to make a flowchart because all I can think of is a loop and the Arduino can't run 24/7.
Why can't you run it 24/7?. A loop should work fine. Every time through the loop, you can check the current time and make sure the 'state" of the gate is correct for that time.
I've never used a RTC or interrupts with the Arduino, but I have a feeling
it won't work unless the clock has an "alarm" feature built-in. You need to compare the actual current time with the target time, and I think
the processor needs to be running (not sleeping) to do that.