I actually made something that uses same algo for finding the position ur at in path. Then, I created a class Node, which is just liek a tile. Node has 2 functions: atNode() and interact() the default interact() for a node is to walk The constructor for this class contains the position of the node. Then I have two more classes NPCNode and ObjectNode that extend node. These 2 classes extend node and override interact method to itneract with the specified object, with the specified verb. (They take id/name and a verb as constructor + the Position for Node.) Also, with the ObjectNodes and NPCNodes i sometimes override the interact() or atNode() methods if i need a more complex interaction.
Finally, I got a class called NodePath which traverses the a list of NPC's (Which includes objectNodes and npcNodes's since they extend node.)