There are people on here who are much more familiar with the Rules than I am, but I think that you're covered under 20-1, which says:
QUOTE
If a ball or ball-marker is accidentally moved in the process of lifting the ball under a Rule or marking its position, the ball or ball-marker must be replaced. There is no penalty, provided the movement of the ball or ball-marker is directly attributable to the specific act of marking the position of or lifting the ball. Otherwise, the player incurs a penalty of one stroke under this Rule or Rule 18-2a.
The part about the movement being "directly attributable to the specific act of marking . . . or lifting the ball" is the part you have to watch out for. If I'm not mistaken, that is what got Brandt Snedeker penalized a while back. I think he accidentally caused his ball to move when dropped his coin on his ball (I think he even dropped it only a few inches above the ball), and because the movement of the ball wasn't directly attributable to the specific act of marking he was penalized.
Someone else may follow up and say that I'm dead wrong, but as long as the movement of your ball can be directly attributed to the specific act of marking, I'd say you proceeded correctly.