title: How do you make a repeat command on applescript activated by a button?
body: <p>I have a applescript code to make a choose your own adventure game. I want to make a command to repeat the entire code when a button is clicked. 
  This is all the code I have:</p>
  
  <pre><code>set volume 3
  beep
  set volume 5
  delay 0.5
  beep
  set volume 7
  delay 0.5
  beep
  delay 0.5
  display dialog "Hello? Anyone there? SOS, repeat, SOS!" buttons {"Hello", "Who is this?"} default button 1
  if the button returned of the result is "Who is this?" then
      display dialog "Nick. Nick Gilbert." buttons {"Ok, What happened?"} default button 1
  else
      display dialog "Oh, Thank god, human contact! I've been longing for this to work and now it is! The name's Nick Gilbert, by the way." buttons {"Ok, what happened?"} default button 1
  end if
  display dialog "Me and the rest of the 42nd mission were heading to the international space station on a standard repair mission." buttons {"Next"} default button 1
  display dialog "We docked with it ok, but then an explosion from an engine in the shuttle killed all on board other than me. The International Space Station was damaged too." buttons {"Next"} default button 1
  display dialog "I couldn't contact Earth, so I built this transmitter. Somehow It can only reach you." buttons {"Lucky me", "Go on"} default button 1
  if the button returned of the result is "Lucky me" then
      display dialog "Lucky you" buttons {"Go on"} default button 1
  else
      display dialog "Whoops, I dropped my radio. What was that?" buttons {"Go on"}
  end if
  display dialog "Well, The reason we were on a repair mission is because the International Space Station is heading towards Mars! I should be able to survive on Mars because there are space suits on board, but NASA didn't let the public in on a secret." buttons {"What's that?", "Let me guess, Aliens?"} default button 1
  if the button returned of the result is "What's that?" then
      display dialog "Martians. And no, they are not peaceful. These 'Martians' are evil. I know that because a fellow astronaut was killed by one when he was exploring Mars. I saw the whole thing through the camera. They are evil and they will kill me." buttons {"Oh no!"} default button 1
  else
      display dialog "Yup, Aliens. And these aliens are hostile." buttons {"Oh no!"} default button 1
  end if
  display dialog "Oh no is right. What should I do?" buttons {"Look for reverse thrusters", "Try to radio NASA again"} default button 1
  if the button returned of the result is "Look for reverse thrusters" then
      display dialog "Nick is looking for reverse thrusters" buttons {""} giving up after 5.0
      display dialog "Nope, No reverse thrusters. I found a machete though :)" buttons {"Darn it"} default button 1
  else
      display dialog "Nick is trying to call NASA again" buttons {""} giving up after 5.0
      display dialog "Nope, not working." buttons {"Darn it"}
  end if
  
  display dialog "Maybye I should try the escape pod" buttons {"Yes", "No"} default button 1
  if the button returned of the result is "Yes" then
      display dialog "The escape pods are online!" buttons {"YAY!"} default button 1
      display dialog "Launching in 10" buttons {""} giving up after 1.0
      display dialog "9" buttons {""} giving up after 1.0
      display dialog "8" buttons {""} giving up after 1.0
      display dialog "7" buttons {""} giving up after 1.0
      display dialog "6" buttons {""} giving up after 1.0
      display dialog "5" buttons {""} giving up after 1.0
      display dialog "4" buttons {""} giving up after 1.0
      display dialog "3" buttons {""} giving up after 1.0
      display dialog "2" buttons {""} giving up after 1.0
      display dialog "1" buttons {""} giving up after 1.0
      display dialog "Escape pod fired" buttons {"Ye-ha!"} default button 1
      delay 2.0
      beep
      beep
      beep
      display dialog "EMERGENCY EMERGENCY! Escape pod going to Mars! EMERGENCY EMERGENCY!" buttons {"Oh no!"} default button 1
      display dialog "Roll the dice. If the answer is 1 - 3 then Nick dies. If the answer is 4 - 6 then Nick lives" buttons {"Roll the Dice"}
      set x to random number 6
      display dialog (x)
      if (x) is less than 4 then
          display dialog "Nick dies" buttons {"Start again", "Quit"}
          if button returned of the result is "Quit" then
              tell "His life in your hands" to quit
          else
              #This is where i need the command
          end if
      else
          display dialog "Nick lands safely on Mars" buttons {"Phew!"}
      end if
  else
      display dialog "That's probably the best choice anyway. What should I do?" buttons {"Look for useful items", "Man the controls"} default button 1
  end if
  </code></pre>
  
  <p>I would like to repeat the script under a command.
  Thank you!</p>