A function, which prints out (recursively) names and content of the current available variables would be a great addition to the stacktraces, you can get via OpenLog.
For notes internal classes, it should print relevant information (like the UNID for NotesDocuments)
LotusSctript: GetThreadInfo(LSI_THREAD_CALLPROC) if is called from the first procedure in the stack must return an empty string.
If you call GetThreadInfo from the first procedure in the stack with parameters LSI_THREAD_CALLPROC and LSI_THREAD_PROC you'll get the same results.
I suggest, that GetThreadInfo(LSI_THREAD_CALLPROC) in that case return an empty string. It would be a symptom of the first called procedure.
It is good to use ...
GetThreadInfo is great for error handling. It would be great to extend with a parameter "LSI_THREAD_CALLSTACK" which records the subroutine/function call history. This would show the path code took before ...