The code I posted was pulled out of a working system, so I’m not sure what you mean when you say “...close to an accessible solution...without actually getting there.” The code performs the task that was requested.
What I’ve provided is a straightforward framework for any situation that allows for complex interactions between the various languages and the user, which is based on events that are going to occur anyway. In order for the LotusScript agent to get the current document you must execute a ToolsRunMacro from within the form. There’s no other way to do it (sans some crazy AJAX code.) Clicking a formula button always submits the form and that in turn always causes the onload event to run upon return. So if these events are occurring then you might as well put them to some good use...which is what I’ve done.