this is a confusing script and i cant figure out how to work it but just saying, it does not have to be so complicated. instead you could make it:
on *:TEXT:*:#:{ if ($1 == !quotes) { play # quotes.txt }