The code is correct. If ever there is yaw input, then it short circuits to manual control. If there is no yaw input (within the deadband), then if there is a roll command > 3 deg/s we fly in coordinated flight, if it is less we fly with a yaw damper.

I can move the conditional to nest just the > or <= 3deg/s for roll, since once the roll stabilization mode test and the yaw input deadband test are passed then we're guaranteed to use one of the two coordinated flight paths.