Thinking out loud: I wonder if it would be possible to use an asciified version of your intermediate form directly as the basis for a new mdoc markup language?
Already done. See: mdoctree(1).