When you resume a sound using the "resume sound" command that has been paused using the "pause sound" command, the "sound playing(sound number)" expression still returns a zero when it should return a one because the sound has been resumed and is playing.
load sound "MachineGun.wav", 1
play sound 1
do
cls
text 0, 0, "sound playing: "+str$(sound playing(1))
text 0, 12, "sound paused: "+str$(sound paused(1))
if spacekey()=0 then s=0
if spacekey()=1 and s=0 and sound playing(1)=0 and sound paused(1)=0 then s=1 : play sound 1 : paused=0
if spacekey()=1 and s=0 and sound paused(1)=1 then s=1 : resume sound 1 : paused=0
if spacekey()=1 and s=0 and sound playing(1)=1 then s=1 : pause sound 1 : paused=1
loop