Identify window with hidden title bar?

Right. I think then that as @griffman suggests, the question about the API that you mention is whether it is public (in which case we can expect Keyboard Maestro to be able to use it). Otherwise, I wonder if you might be able to either (a) edit the Lua script or (b) look at how the script is called, with the aim of toggling the title bar on temporarily so that the title can be got by KM. That is just a shot in the dark because I have not as yet got into Reaper that deeply.

By the way, I think that when you write that the Lua script is “running on the touch screen”, you simply mean that the touch screen happens to be the display that you are using to see the script’s window; the script is running on the Mac, rather than some extra computing resource offered by the touch screen. So I think that whether the script window appears on the touch screen or on another display is a red herring. If it is however an important factor that the window appears on the touch screen, please let us know why.