I can provide you with my custom string library that handles tokens if you want to. It fully supports (it's not yet complete, I only completed what I needed for the moment) $*toks like mIRC's way of doing it. You can also us it to compare arguments like :
if ( input.gettok( 2, " " ) == "blah" ) {
...
}
It is what I use in creating my DLLs and was built as a learning part of making my own "string" library which I added token support afterwards.