Way back when I was a junior, I was the anchor bowler in the last week of bowling. I needed a spare and three pins in the tenth to win the game which would give us first place for the season.
I threw the ball a tad high and I expected a four pin leave for an easy spare. Sure enough, the four pin was standing, but...a pin laying in the channel was struck by another pin. The pin in the channel flew up and stood when it landed...right in the six pin spot. I couldn't convert the 4-6 split and we lost the league.
In the rule book, its: "Rule 7b. Pins that rebound and stand on the lane must be counted as standing pins."
I don't think JohnP's question is answered in the rule book. I'd vote that you should spot the pin to the closest pin to the ending location.
--------------------
Good luck & good bowling