This is similar to How can I create a set of shared `set` and `show` rules which can be imported into a theme? - #3 by ParaN3xus and can be sorted out by wrapping your code into a function that will be used as a template for your document.
Also see Making a Template – Typst Documentation as it describes the process step by step.
#let my-template(body) = {
show heading: set align(center)
show heading: set text(font: "DejaVu Sans Mono" )
show heading: it => block[
\~
#emph(it.body)
#counter(heading).display(it.numbering)
\~
]
body
}
Then
#import "dragon.typ" : *
#show: my-template
#set heading(numbering: "(I)")
= Dragon
With a base health of 15, the dragon is the most
powerful creature.
= Manticore
While less powerful than the dragon, the manticore
gets extra style points.