I think Trace is what you are looking for, from Help:
The trace statement writes a string to the Script Execution Progress window and to the script log file, when used.
It is very useful for debugging purposes. Using $-expansions of variables that are calculated prior to the Trace statement, you can customize the message.
The syntax is:
trace Main table loaded;
Let MyMessage = NoOfRows('MainTable') & ' rows in Main Table';
Hope this helps!
I knew about the TRACE statement elsewhere - but I would never have thought of using it in this context.
That is the sort of thing I would propose for putting into a WIKI for every newcomer to consult - if I had known this about a year ago when I started doing this, it would have helped me a great deal.