We have a few resources to help you develop your own Draft template scripts:
Sample Scripts
Included in your Deadline repository: \REPOSITORY\draft\Samples
These are a good starting point for writing your own scripts.
Programming Reference
A description of all of the functions available in Draft.
Cookbook
Code snippets to perform common operations in Draft.