exit repeat loop with button

How do I set up a button that will stop a repeat loop? Both buttons are active in the test script shown below, but only “Escape” will work to exit the repeat after “Start” is pressed.

on clicked theObject
set ChosenButton to the name of theObject
if ChosenButton is in {“Start”} then
repeat
beep
delay 2
end repeat
end if
if ChosenButton is in {“Stop”} then
–here is where I want the repeat loop to stop
end if
end clicked

Weldon