I think it says to execute the script whatever this means. The main method is called from within Groovy code. InvokerHelper#createScript is responsible for it in the end. But here basically is a problem. Should a class be executed? or should the class be returned? A script is a class to. It behaves a bit different, but it is in fact a class, one with a run method, that will be called directly. The current code does anything that is no script in a script, that executes a main method of the wrapped class. Well, maybe wrapper is so good not, proxy is probably better.
What for example if your class is a junit test. Do you expect it to be executed, or the class being returned? Executing it means to run the test, returning the class means not executing it. You probably say the script returns a class, but there is no script, just the class. The script is a short form of creating a certain kind of class. So for Groovy the basic concept is the class, not the script. From that point of view it behaves absolutely correct.