You can get around the $1 issue by doing a simple tokenize 32 %nick just before the slap command is issued, but the $chan issue is more complex. You're not going to be able to solve the $chan issue without rewriting the script so it works a lot differently.
Why dont you just find/replace all instances of $1 and $chan in notepad?