Dynamic post-function configuration form

I am writing a post-function plugin and I want the configuration page to be dynamic, pulling in JavaScript library to update the fields (i.e. AJAX calls). I have tried embedding the tag in the .vm that I customize, but it appears not to function after Jira includes my .vm into the base page .vm file.

Any tips on how to create a dynamic post-function configuration page?