looks ok .... stop loop tough stops the loop condition for which the action "stop loop" is set upon.
else will fire no matter if you have stop loop in that method(because is still a Else valid argument, anything that isn't above being it null, error, NaN, infinity, even halted status of loop, or not the values above etc will fire Else).
what you can try is.... add another blank subevent under else ... not as a child of else but like a 3rd condition on spacebar pressed ... then move the stop loop there. see if that works... but then stop loop would not have a loop to work with ... ehm ... maybe Else is not best use here ... you could try pinpoint when exactly you want the error to fire... for example
if space was pressed
u got a variable that its value is set to a random between of 5 and 25.
condition 1 loop is true if matches the variable above... play this audio ... right?
condition 2 (should replace else ) and pinpoint what would be the desired condition here, like if loopindex("testloop") total loops equal to zero matches to textcheck then trigger error.
you can do that by saving your loop into an array and record the match, if it matches 2 3 times then you can play the audio based on array entries and if it doesn't matches the array then trigger error. is a bit convoluted for something simple like this. not sure what is the purpose of your test, like what is it meant for .. probably there is a simpler or better way of doing it and avoid the loop/else problem entirely.