Can a macro be used to alter another macro?

The Keyboard Maestro editor is scriptable, so yes, you can edit macros via AppleScript, which can be run from macros.

Obviously, you should be very careful doing this.