You would have to run your animation code inside a sentinel type loop such as a while loop. The sentinel condition being that you received the correct user input which would cause the loop to exit and continue on. This probably won't work exactly as you are expecting because Python is after all a scripting language and executes the commands in the script line by line. You might be able to achieve something more like you would want if you involved threading in which case you could perform multiple tasks simultaneously but threading can be difficult to get right.
userInput = ""
while userInput != "r" or userInput !="q":
userInput = lower(raw_input("Enter letter: "))
This setup would run the animation once per iteration of the loop and at the end of the loop ask the user for input. Until they enter r or q it will continue to loop.