Automating the Keyboard Maestro Editor with AppleScript

While not an answer to your question about the macro you were using, as an alternative, this is the macro I've been using since KM 8 to show my recently used macros and quickly choose one for editing: