Hi there,
I'm from a Creative Cloud developer experience team, and I don't have an immediate answer to your question, I just wanted to let you know that I'm deeply invested in your problem.
I also wanted to share that I bookmarked this post because it represents a common user story for scripters: You want to solve a pain point in your workflow so much that you're nearly willing to dive into the C++ SDK for your usecase.
If you do want to try the SDK, I'd recommend downloading it, documentation is included in the download, here: https://console.adobe.io/downloads/ai You can search through the download to try and find commands that could help.
If you want to try the Extension route, that's called CEP, and yes, it's HTML with UI, here's the documentation and a Getting Started Guide (Photoshop is the example, but the same steps will work with Illustrator). If you weren't able to find the ExtendScript command you needed in JSX in seems a bit unlikely that CEP will help...