FYI: This is a better post for the haml mailing list. To summarize, I don't think you can accomplish this via a custom function; Nathan may know a trick that I don't tho.
A couple reasons:
1. The Sass::Plugin has special handling of the @import directive for quickly building a dependency map of files so that Sass knows when files are "out of date". If you use a function like this, compass and sass may not recompile your sass files when their dependencies change.
2. Function calls don't have a way to modify the document structure. Even if you accomplish parsing the import directive (Hint: no need to parse anything, you can just create an ImportNode directly), the calling document doesn't know that the import statement you created is part of the document.
If you're serious about this feature, you should work on a patch for the Sass Parser to allow for a glob syntax to be passed to the @import directive.
Also note that sass imports files are imported off the Sass load_path, imports must be relative to one of the entries on the path list (which always contains the current directory of the sass file being parsed). However, for clarity, I think a glob syntax should only work for the directory containing the sass file that's using it.
chris