Unfortunately, I don't have the IPCCX 4.x editor available. However, the Text Substitution step takes keywords in a template XML file (keywords begin and end with a %). The resultant file (after substitutions) can be written to a different file.
So, the process would be to read the current values from the the state.xml file, and use the template to make the necessary substitutions.
Have a look at the State_Check and State_Update examples in the Script Repository:
http://www.cisco.com/en/US/products/sw/custcosw/ps1846/products_implementation_design_guides_list.html
I've used this technique to open and close CSQs outside of the normal call flow, and as a flag to decide whether a "message of the day" should be played.