Exclude Stuck Units Grid

I’m using a grid.
I am doing rvoController.locked = true when a unit stops moving.
If I have a rvoController.locked = true unit that stops on the way when another unit gets directions, I want that path to be set to unavailable. How do I do this?