Simon,
Have a look at the microchip web site for their ap notes on motor control. If it is a DC brushed motor your talking about (i.e. two wires only), then the H-bridge should work just fine. When you just say a 24V gear motor, the reader does not know if you are talking AC, DC, brushed or brushless.
You could use limit switches that trigger when the max movement in each direction is obtained. Run the limit switch triggers to a micro along with the trigger from your PIR. Most PIRs have dry contacts so you basically would have 3 switches to debounce in the micro and then the micro could in turn drive the H-bridge. Since you are using a gear motor, it will probably over-run a bit when power is removed, so have your limit switches cam operated so that they are not used as physical hard stops. You might be able to use a PTC poly-switch to break the motor current path should a hard stop be encountered.
Bill