How to Approach KM-Based Audio Input with Command Execution

Hello all (especially Peter), thanks for the wonderful resource you provide for us.

So I am trying to make some kind of trigger that would make it possible to read commands into my Mac via voice, and have them be processed in an Applescript, which would do certain things depending on whether it was text I wanted inserted into a document, or commands I want it to execute, like "Read line 10 to me" or "change 'cat' to 'dog'." I can do all of this in Applescript, if I can get the basic methodology working.

I know Apple's voice control system can sort of do voice commands, but doesn't work well enough to do what I'm trying to do. It's terribly inaccurate, and there's no way to add words to the dictionary or perform post-processing to fix problems.

I gather there's no good way to launch a KM macro through a voice command, so I will have some kind of trigger using the keyboard. I'm trying to get an idea of how to approach this, though. How can I, using KM, achieve what I am looking for? One idea is for a KM script to bring up Text Edit, dump some spoken text into a document using Siri dictation, then post-process that text. Is there a more elegant way to do it inside KM somehow?

Thanks in advance for any advice you can offer!