These customizations are for making the resulting asciidoc CORRECT. Read the comments, they explain what's being done. I was unable to find an extension or flag to pass to pandoc to perform these substitutions, so I wrote my own.

As to how often, it's most likely a one time thing. However, if we need to be able to convert from .adoc to docbook (for import to CCMS) then we MAY have to store the .md format instead of the .adoc one, and perform this conversion every time we want to dump a new copy of the files?

Why, you ask? Because I'm not sure that pandoc supports conversion from .adoc to .xml directly, whereas it DOES support conversion from .md -> .adoc and .md to .xml.