I'm sorry if I muddied the waters on this one.
I probably should have said something like, hey, others have offered fine solutions, would this supplement your needs? Instead I sounded like I was nitpicking on active vs. enabled distinctions--which I am not always clear on either.
This might help in deciding if this macro can be of use to you.
The prompt list source is primarily from the AppleScript "gethotkeys" command in the Keyboard Maestro Engine Suite. I added the option to append the Smart Groups you mentioned.
Whatever "gethotkeys" decides is an "active" macro is what appears in the prompt list.
The scripting defintion puts it this way:
gethotkeys (verb) Gets an array of groups of arrays of macros that are currently available via hot keys or typed string triggers. (from Keyboard Maestro Engine Suite)
The optional getall parameter: "retrieves all active macros, not just hot key and typed string triggered ones"
The macro allows for setting the getall parameter to true or false.
I'm afraid I don't know how availability of macros to AppleScript plays out in gethotkeys's rules of inclusion--but am curious now.
But here are a couple of ways to check what gets included:
The count of of macros/groups is displayed in the prompt list In the case of macros, either a count of those that have at least one of the 2 types of triggers described or all that the command considers active, if you have set the getall option.
The items shown by Show Active Macro Groups menu of the Keyboard Maestro status menu are fairly close to what gethotkeys shows, I believe.
FWIW, here is the post that prompted the demo.
If the macro doesn't suit, nevermind...
If it sort of fits, but needs adjustments, I'll rejigger what I can within what gethotkeys can do, such as getting a subset of "active" macros by typed string trigger or hot key.