Two main methods:
Use a second command assigned to the same button, but with the "Shortcut is invoked only when all buttons are released" option enabled
Or, add a loop to your command that waits for the button to be released.
E.G.
Play sound, 'internal:Iamon'
Start Loop While : Joystick 1 Button 1 Is Pressed
End Loop
Play sound, 'internal:Iamoff'