You dont need to make a script to do that, a quicktext can do this. You can do that by using the tag (!N), wich displays your contacts friendlyname (name as set by contact him/herself).
Example of a quicktext using this:
With this i can send the old/known /slap command.