Best is to use the dojo loading mechanism. In top of the .js file of your library add:
dojo.provide("path.to.my.library");
and in the widget add on the top (or in the postCreate for lazy loading)
dojo.require("path.to.my.library");
The advantage of this approach is (in contrast to Roelands approach) that dojo will make sure that the library is loaded before your widget, so that the widget can refer safely to it. Furthermore dojo ensures that the library will be load only once, even if multiple widgets refer to it. Simple chart provides indeed an example of this approach.
var myModuleLoad = mendix.dom.script({"src" : mx.moduleUrl("MyModule",'js/additional.js'), "id" : 'MyScript'});
document.getElementsByTagName("head")[0].appendChild(myModuleLoad);
this is wat I've used in javascript.
I dont know if it will be cached.
I also found a way to apend a javascript library in the widget. You could take a look at the simplechart widget in the appstore.