http://osbot.org/forum/topic/55480-walker-with-basic-obstacle-handling/
The reason why it walks to the second position then walks back to the first is because you have only one loop, you loop though the position, since your looping from the beginning to the end. Your near the first position it will walk to the second, and once your walking it's still looping through the positions from the beginning so while your conditions are correct it will go back to the first. Why it's a never ending loop.
In swizz method he has two loop, regular loop, and a loop in reverse. He uses the reverse path to find the next furthest available position.
Rather then looping and finding the closest tile from the beginning of the loop.
If you don't understand me look at his method, get next tile and read it