How to create a top down movement system like Diablo

You can just stop movement before closing the gate.

Also, you can use a distance node rather than subtracting and getting the length.