Couple of ways, easiest is path finding.
Give the npc 4 variables, 2 are its initial position. And for each npc on start of layout set these to its current coords.
The easiest way to find the coords it wants to go to, are place it there, and copy it's numbers.
However, an alternative method would be to have lots of tiny sprites littered around with a variable that relates to the npc who is walking between them. On start of layout, for each npc, pick the nearest sprite with the same variable number. Find path.
Then npc on arrived, pick furthest sprite with the same var no.
This method is good as it's like 2 lines of code for all npcs. All they need is corisdonding variables. Good luck.
(Note* you can have pick random sprite for a more sporadic movement)