Maybe the prototype based code isn’t being fired properly because of the late-loading of the library.
All code depending on the library should be loaded after the library. Perhaps there’s some documentation on the Prototype site detailing this kind of late-loading?
If you need to your libraries and such dynamically using JavaScript a great way i have found to do it is to use a small API called Require.JS, basically it loads a list of files you specify in an array and only runs an anonymous function you pass to it once all the libraries have finished loading.