I've spent quite a bit of time looking at this problem, and it is considerably more complicated than you think. The point of reversal in Dec drift is a function of the azimuth and altitude errors in polar alignment. If you have a permanently installed system, you can know ahead of time at what sky location this reversal point occurs. This is not the general case, by any means, and deducing that sky location in real-time by watching the Dec activity is difficult and typically unreliable - especially if the mount exhibits other problems relating to its Dec axis. Your system, for example, shows these kinds of behaviors (Dec in green):
This is from side-of-pier west where you need to use north-only guiding. These are pretty clearly caused by something shifting around in the payload, probably the guiding assembly, but they exemplify the reality that setups with severe Dec backlash or stiction usually come with a basket load of other problems.
That said, it could make sense for you to force an automatic switch in Dec direction at the sky location where it is needed - since you are permanently set up and presumably don't change the polar alignment. Rather than flailing around in the PHD2 source code, you would be better advised to write a simple app that uses the PHD2 server interface to accomplish the job. It can monitor the hour angle position of the scope and send the appropriate command to PHD2 to reverse the Dec direction when your particular "trigger point" is reached.
Regards,
Bruce