Ok... I found it out by myself...
There's a MAX range of cells that if you go over it, the script will fail.
Also, you can't go over obstacles or walls, even if they are in sight.
I tried this and the poring walks a perfect square:
Thanks anyways for your attention, the ones who read this.