You should be able to add the template block at anytime in the life cycle of your page. However before you use this or the micro-templating engine it must exist to actually work. It would be no different than any other DOM element on the page. The text/html thing is a trick to keep the browsers from evaluating the block as a js block.