Switch triggered by flashing light
Olin's suggestion of micro-controlled system will definitely provide you with the most control and flexibility but if you want to mess around with a linear solution the following circuit sort of works in the simulator at least.



PHOTO-TRANSISTOR

Note I picked a photo-transistor for this model. Actually, for the simulation I used an opto-coupler so I could manipulate the signal levels. That may be over-sensitive for your needs and a simpler photo-diode may be sufficient. It is important you set it up so it works with the area lit in full sun, with the sensor itself in shade. If you can get it to work under those conditions it should work in the dark without issue. There are a lot of choices of devices on the market, most of them are relatively cheap, so you may want to buy a variety of types to test for the best results.  

DIFFERENTIAL CHANGE SENSOR

I decided to go with a differential input using the photo-transistor. 
The amount of illumination present is supposed to change how much current bypasses R3 changing the voltage difference across it. The change in voltage here when the headlights flash is passed through the two high-pass capacitor C2 and C3, the output of which are biased at half-rail. The bonus of this differential method is you can mount the sensor remotely from the rest of the circuitry through appropriate twisted pair shielded cable.

LOW PASS DIFFERENTIAL AMPLIFIER

This block takes the differential edges than make it through the sensor circuit, filter out high frequency noise, and amplify the result to produce a waveform biased around half rail that will modulate when light transients occur at the sensor.

SCHMIDT EDGE DETECTOR AND INTEGRATOR

This section uses a comparator with a threshold value to detect when the waveform generated by the above is strong enough. The edges of that are extracted by C1 and R20 and fed to the integrator U5.

As each flash occurs the voltage at the output of U5 will grow in steps.

THRESHOLD DETECTOR

This comparator is set up to generate a low level output that will trigger the 555 timer when the voltage on the integrator reaches the threshold level and will maintain it low till the voltage drops back close to mid-rail.

1 to 3 MINUTE GATE OPEN TIMER

I decided to use a standard 555 one-shot circuit to generate a long pulse output suitable to flip a relay to drive the gate. Since you did not seem to have any information regarding what was needed to do the latter, I kept it simple. (Before I get yelled at for using a 555... yes I know.. it's cheating.. but hey, for something simple like this they are still the cheapest, less fuss, way to do it.)

OUTPUT DRIVER

As you can see, the output driver uses a MOSFET that, for not, turns on an LED, but you can hook in a relay coil, with a fly-back diode, in parallel to R24 and D2.

VIRTUAL GROUND REGULATOR

I decided you probably want to use a simple power supply for this and I chose 12V for the simulation. It will however work on a variety of voltages though some tweaking of values may be required. In order to make it single supply, this little circuit generates a virtual ground, basically half-rail which is used in a few places as indicated by VG.



As I say, the above seems to work in LTSPICE, but whether it works in practice in your actual setup conditions is not guaranteed. The circuit seems quite sensitive, but in no way is optimized, and without actual parts and conditions it is impossible to tell if it is even close. I definitely suspect you will need to play with R1,R2 and R3 with the actual devices and in sunlight vs darkness to get some sort of compromise. Be aware though, circuits like this are notoriously finicky, and unless you are up to the challenge and have the appropriate equipment, including a scope, it may be beyond your current ability. Either way, the circuit may give you some ideas of where to start. Anyways, good luck.