Open the template for editing. Add the macro code to a new module in the template's VBA project. Save and close the template. It should not affect your autotext entries. However creating a new template and saving it over the original will certainly overwrite any autotext entries stored in that original template.
See also
Installing Macros