If you want to allow multiple words, you can just add more arguments. If a client types in "/eval sifawkljfalwkgjawg," it won't go through serverCmdMessageSent; the client just uses commandToServer for the command entered.
function serverCmdDingus(%client, %a0, %a1, %a2, %a3, %a4, ..., %a15) don't remember off the top of my head what the argument limit is
a quick way to turn them into one string:
for(%i = 0; %i < 16; %i++)
%msg = %msg SPC %a[%i];
%msg = ltrim(%msg); //ltrim removes the first space which shouldn't happen HAHA!!
not sure if it's more efficient processing-wise to just use a ternary operator or something to avoid the space at the beginning but that's possibly SCARY!! and also i don't think it's ridiculously imperative to get the extra milliseconds it would give you
getWords(sourceString, startIndex, endIndex) - returns words startIndex-endIndex in the string
e.g. getWords("a b c d e f", 2, 3); //returns "c d"
to execute a client-sided script with a serverCmd, you would need a clientCmd on the client-side which the server would activate with commandToClient(client, 'command', args...);
to trigger something when a word is said, it would be similar to what you're doing with the code in the OP; you would search the message for the string and call w/e function. on the client, you can do the same thing packaging a function related to sending chat (not quite sure what the best one is off the top of my head)