SCL™ Basics
Now we can't make it shake forever so we'll define a variable to count how much it has shaken.
Variables, created with 'create var', are able to run a routine when their value satisfies a condition. This lets us set a counter and have a routine run when the count equals 5.
editable

create var as lets us name a variable and set conditions for it. In this case, when the value is equal to 5, we run the indicated completion event.
Of course we need to change the value of our variable so each time WiggleRightDone is called, we add one to its value.
Finally, in the completion event for the variable reaching 5, WiggleDone removes alterations that move the sprite. This stops the sprite.
As it is, if you click on the sprite again, it will wiggle forever because we haven't yet reset the variable to less than 5.