There are two significant problems with the way handling of URLs as scripts are implemented in GroovyMain. I put them both here since I think any relevant changes will be done together.
The first (and simplest to fix) is a buggy URL checker (GroovyMain.isScriptUrl(String urlOrFilename)) that has a hardcoded (and case-sensitive?) list of URI schemes that it tests for (http, https, file, and jar). This checking should be done by URI's parser and support any scheme that the platform implements.
The second and more substantial issue is that when a script source is specified by URL a correct URL-based SourceUnit does not get used for compilation. Instead the text is simply grabbed from the URL and parsed as a string. This is inconsistent with the way URL-sourced code is handled everywhere else.