Not the person you asked, but this sort of thing is pretty easy with templating languages, such as Perl's Template::Toolkit[1] or Python's Jinja2[2].
The advantage of a system like that over a plain programming language (such as Lua you mentioned) is that there's less escaping and string.format(xxx) sorts of things. The output text is the primary thing and the templating language has its own special syntax to "activate" it when you need it, rather than the other way around.
That being said, Lua's square-bracket strings are pretty good for bulk text, too (:
[1] http://template-toolkit.org/about.html
[2] https://jinja.palletsprojects.com/en/3.1.x/templates/#synops...