this might be too simple for what you are trying to do, but my solution would be have an array of positions from the player node, whenever they move.
if Input.is_action_pressed("move"):
position += Vector2(x, y)
path_array.append(position)
Have that list only like 35 positions long though, or whatever distance you want the NPC to stop at.
Have the NPC follow behind your player along this path, I'd say use position.movetoward(patharray[index], position.distance_to($player.position) * delta)
Then, when you have the NPC where you want it (when the player is stopped), set a timer, and once it runs out, let the NPC start moving around, but then go back to it's position once new elements start getting added to the array, once the character starts moving again.
I know this response is written kind of sloppy, but I hope you understood the basic gist.