Well that's invalid syntax, so that might have something to do with it.
Could you explain what you mean?
Also, the original code above actually works. I just cant get the script to read past it (even if the rand() is set 1-20, it works). The next block of code (!stest command) works as well but only when I comment out the sweetheart coding.