If you are looking to do this with a mapkey then you will need to use an external script to manipulate the string(s). Mapkeys can only record UI actions in a Creo session. Text editing in this context you are working on is done via pausing for user input to enter text. You can call an external script with a mapkey. You can nest this external script call in other mapkeys.
You can reduce timeouts in the vb-script ("WScript.Sleep 100" means 100ms timeout).
Also you can call other predefined mapkeys from a vb-script. It would be something like this: WshShell.SendKeys "mtlset" where "mtlset" is the name of the mapkey.