That is great if that is what you like to do. For my entire career that has led me to do software development on a wide variety of computers, from main frames, to minicomputers to windows to Mac, I have always preferred to start my development as high up the food chain as possible.
I would rather spend my time on solving the task at hand rather than developing tools needed to do the task, especially when someone else has already developed the tools. So I have employed software libraries and third-party add-ons throughout the years.
Thankfully, there are those that enjoy tool development. I greatly applaud them! And I love to use them!
In this case, I have found that AppleScript and Keyboard Maestro make great partners. It is easy to combine one or more AppleScripts in one KM Macro to accomplish a given task. KM makes it easy to do things that either could not be done in AppleScript, or would be laborious to do so. And the reverse is true as well. I cannot create an app that I can distribute using KM, but obviously I can do that with AppleScript. So, for me, it is a matter of choosing the right tool for the job, where “right” often means (to me) the easiest/fastest way to develop the automation.
As always, it is great to have options so that each of us can choose the method that works best for us. Thanks for sharing your solution.