if your script does not need to run in the context of a specific business object (like your example above) you can simply start it with the 'Publish and Run Now' button. It will take a few seconds and the script will run.
You could as well link your script with a Web Service Script quick action and then run it from the Action Menu of the particular business object. That way you don't have to create a situation in which the trigger fires.
For logging I typically use console.debug (or console.error for real errors) and set script logging to 'Debug'.
Thanks for the response, Bernd.
When you use logging (console.debug, etc), where are you viewing the log files?
First, I don't really know, if the debug messages make it to the Log workspace in Heat; I believe, they do. And then you should be able to find the messages there.
The messages are written to the AppServer.frslog files, but those get deleted after being consumed by the Logging Service.
I 'improved' Heat logging by adding a second appender, which accumulates log messages in my own, separate log file; you can do this by modifying the log4net.config file in AppServer: duplicate the ASPCustXMLAppender, give it a new name, change some params (as below), and add it to the root section at the bottom. My params are
<param name="File" value="D:\Logs\AppServer.log" />
<param name="PreserveLogFileNameExtension" value="true" />
<param name="RollingStyle" value="Composite" />
<param name="AppendToFile" value="true" />
<param name="MaximumFileSize" value="10MB" />
<param name="DatePattern" value=" yyyyMMdd" />
<param name="MaxSizeRollBackups" value="-1" />
<param name="CountDirection" value="1" />
<param name="StaticLogFileName" value="true" />
You have to set the log level of service "Script" to DEBUG or INFO if you want to see your console output in the "Logs" workspace.