In the latest stuff that is there on github, you can create an internal static class with just a static ctor, and mark the class as [ScriptModule] - it will generate top-level code. Think of this as main() for any particular script file.
Hope that helps.