Hi There,
This actually shouldn't be necessary to reverse engineer something of this nature. Exporting to a SQL Script was added with the 4.0x hotfix, and will be natively present in 5.0:
Q113506: INFO: Workflow Manager 4.05 Now Available
http://kb.acresso.com/selfservice/viewContent.do?externalId=Q113506(note: this will be an extra option when you use the 'Copy' button in the Templates view)