Instrument eclipse classpath from modules defined in @Grab groovy annotations

Hi all,
We are building an integrated development environment for non-software engineers, based on Java/Groovy. The objective is to provide them with the capability to write groovy scripts that integrate internal and external java libraries. In addition, we also want to bring to them an IDE-based development environment to smooth the learning curve. Ultimately, we want to provide the same ease-of-use as writing python script while leveraging all Java and groovy capabilities.
Our approach is to provide to engineers the capability to write groovy scripts that can run stand-alone and use Eclipse as the editor platform. This seems a promising approach so far but we have a road-block to move around.
We recommend to use @Grapes/@Grab statements to integrate third-party libraries in groovy scripts. The limitation we meet so far is that eclipse does not detect the @Grab statements as defining external libraries, wich prevent from using all code completion features. One work-around I found is to add manually the corresponding libraries in the build path of the eclipse project. This is however cumbersome and error-prone.
One solution I can see is to scan each groovy script and automatically add all @Grab components to the eclipse class-path. This would solve nicely the problem for our users.
When I look at what gradle provides to integrate IVY repositories and generate the eclipse classpath file, it seems that everything I need is there: picking jars from description, adding files to class-path. My feeling is I just have to write the script parser and call the right API. Can you confirm this? Can you give me some hints about how you would proceed to implement this? Can this be done through a gradle script, or is it more comvenient to write an Groovy code that uses Gradle classes?

Thanks,
Loïc.