I poked around and the lastVisited function looks perfect for this since it can track how many clicks/rooms away from a particular Room X the player has gone.
With a value of -1 being never visited Room X , 0 being in Room X, 1 being just past Room X, and 2 being two turns/clicks past the room, I'd want the link to Room X to deactivate if lastVisited("Room X") is equal to 1. For all other cases, if lastVisited("Room X") is less than 1 or equal to or greater than 2 the link should stay activated or be reactivated. This would have to work for each of around 20 rooms.
How would I implement this?