You can get a hydraulic diverter valve, hand operated. I used one once for a baler with hydraulic tie. Don't remember the brand name or how much it cost, but it wasn't expensive.
The outlet on the tractor was plumbed to the diverter valve and regular Pioneer connectors were plumbed to it. The two hose sets from the baler were attached to the outlets. In your case, as I understand the problem, you would use the tractor control lever to raise to gate, then switch the diverter to the other set of lines to lock the gate, again using the tractor control lever.