I realized after writing my own question that I needed to add all the code in the tag proc, through "template::adp_append_code" -- and that did the trick. But thank you for explaining why it actually didn't work!
/Stc