...go ahead and read the manual, we won't tell anyone.

Help Topics > All Functions > Sound

The sound function returns the name of the sound resource currently playing (such as "boing") or the string "done" if no sound is currently playing.

Usage:

the sound
sound()

Example:

wait until the sound is "done"