The topic you replied to is very old, I guess from when Ready API was just SoapUI. I think the problem with the script above is the tab names within the GUI have changed since the original reply. The tab name is no longer called "groovy log", it is now "Script log".
It seems to work if you update the name of the tab in the script. Please note: I do not know if this is a recommended way of clearing the script log or if there is another better way. It seems a bit fragile to reference GUI labels in your script.