To be clear, KM can't do that. But my macros can.
As for storing previous versions of your macro, you could take a look at this macro set from me:
You can store the macros as JSON or XML, and restore them any time you want to. I also use Git for version control.
Yes, you can disable groups from within a macro. Just look for actions that talk about enabling or disabling macros, and they can also do Groups.
Yes, you can delete them using AppleScript (or JXA). You do it by UUID, not by name, because names don't have to be unique. I'm sure if you did some searching in the forum, you can find examples.