Hello Darryn,
If I understand your question correctly, you want agents to be able to enter a credit card number without typing the hyphens themselves, and then have the system automatically insert the hyphens. For example, you want the agent to be able to type "1111222233334444" and then have the system transform that to "1111-2222-3333-4444."
To do that, you need to make the original variable for the credit card number a dynamic variable (https://help.mypurecloud.com/articles/dynamic-variables/) and the Scripter.Set Variable action (https://help.mypurecloud.com/articles/available-actions/).
In the Scripter.Set Variable action, you could use something like
substr({{Credit Card Number}}, 0, 4) + "-" + substr({{Credit Card Number}}, 4, 4) + "-" + substr({{Credit Card Number}}, 8, 4) + "-" + substr({{Credit Card Number}}, 12, 4)
to modify the original variable to add hyphens every four digits.
Is that what you were trying to accomplish? Let us know if you're trying to do something different and I can try to clarify.