Or better yet (requires no modification of the script, only extra files):
alias -l cmdfile { return $scriptdirCommands\ $+ $1.txt }
on *:text:!*:#mychan:{
if ($1 == !latest) { .notice $nick http://www.some_website.com }
elseif ($isfile($cmdfile($mid(1,2)))) { .play -n $nick $qt($cmdfile($mid(1,2))) }
}
For this to work you need to create a "Commands" subdirectory in the same directory as the script, and put all of the different text files you want to be able to play in that directory.