I've created my wandering NPC's in my zelda game by creating a sprite object called "pathsprite" and in each frame have images for the avialable directions (make sure you set the speed to 0 so it does not animate) for example:
frame 0 would have a image of an arrow pointing to the left
frame 1 would have a image of an arrow pointing to the right
frame 2 would have a image of an arrow pointing up
frame 3 would have a image of an arrow pointing down
frame 4 would have a image of an arrow pointing up,down,left and right
frame 5 would have a image of an arrow pointing to up and right
do this for all possible directions you require then set up logic like this
If player overlaps pathsprite and frame = 0 then set "NPC" movement direction to 180
If player overlaps pathsprite and frame = 1 then set "NPC" movement direction to 0
If player overlaps pathsprite and frame = 4 then set "NPC" movement direction to choose(0,90,180,270)
Also do a check position for when the NPC is (say) 4 pixels or less in distance then set NPC to the position to the pathsprite its overlapping. This ensures it goes throught the center of all pathsprites, you could also have the NPC wait at various places with a random timer to give the impression the npc is thinking were to go.
Hope that maks sence im at work so unable to provide screen shots.