And of course there is the Hey source itself, which you could use as a reference to write a new scripting platform with (https://github.com/haiku/haiku/blob/master/src/bin/hey.cpp).
Honestly, I just find it convenient to get a list of URLs, and dealing with regular text files. Sometimes interfaces are too limiting r slow, and manipulating the list in a text editor ends up being easier.
Another of my use-cases for this is to regroup tabs when I fork into random topics. e.g. Sometimes I end up opening a bunch of tabs that are tangentially related to the subject and I want to move em into a new window or stash em for later.
It's also convenient to grab a manually opened list of URLs in cases where I want to perform some one-off scraping task.
Its gotten to the point that I can't seem to really function on a new MacOS installation without my personal Hammerspoon repo set up .. I'm not sure if thats a positive or a negative result of having such deeply scriptable interfaces, but perhaps it can be looked at both ways.
Over time I've built up a small list of utilities for common UI interactions. Here's an example: Get the list of tabs from the frontmost Safari window [0]. Occasionally I'll be researching some topic with a bunch of tabs open, and I want to go work on something else. When that happens I just grab all the URLs in that window and save it in a text file which I re-open later when I want to continue researching the subject.
IMO, the biggest problem I've encountered with OSA scripts (and presumably it also applies to this hey tool) the lack of REPL and inspector. On macOS you can use Safari's dev tools to debug JS OSA scripts, but it's incredibly brittle. Trying to access certain object properties will just cause it to crash, or it might print the identifier of the thing which you're accessing which doesn't add much value.
[0] https://gist.github.com/cesarandreu/8d6ccd70bcac81d1a45941ae...