If I understand you correctly, then you simply need to add another condition (if distance to target < 10) child of the same Dynamic Sequencer that has the LOS, InFront checks.
As such, if the condition is not met (target exceeds a certain distance), then the soldier will continue patroling.
I’ve attached the BT changed.