Would it be within the scope of this extension to do something similar to what js_pipeline does and provide a js function, which will produce the code required to display the script in the browser?
Something similar to this perhaps: https://github.com/carrot/roots-js-pipeline/blob/master/lib/index.coffee#L47