If anyone has a source online that they have used that will help me write my own please let me know, otherwise any input would be much appreciated.
You need more than a formatting script: A formatting script will format a correct value in a certain way. However, when the user enters data, you don't know yet if the data is actually in either the two digit numeric format, or just the letter "X", so you need to verify first that that is the case. This can be done either by a custom keystroke script, or a custom validation script - or a combination of the two. Once you know that the data is correct, you can then use your custom formatting script to correctly format the data (if there is still a need to do that).
Thank you so much for replying so fast! I really appreciate it. What you are saying makes complete sense... I will start with validation.