Firstly, you can import styles from attached template more simply
Code:
ActiveDocument.UpdateStyles 'Imports styles from the attached template
Secondly, where is the code you are running residing? If it is in the attached template and you then change the attached template, how does it stay available? Perhaps place the code in Normal, an addin, or document if it includes changing the attached template.