Put the two valves on a Y lead and take the signal wire of the gear valve through a micro switch mounted on the door to operate when the door is close to end of travel. Have used this system on my f18 to stop the front and rear main doors clashing without needing to have loads of clearance round them!