Hi Patrick. Since IOL is not an officially supported technique, it would be safest to try and solve things via native methodologies to ensure your application is supportable and stable long term. What you could do is create a dbpage and have a formula-URL button call that page and pass in the necessary variables for your code to execute the queries. Keeping this contained in the javascript pages without pushing JavaScript into the buttons is cleanest.
I would also encourage you to specifically post on UserVoice about having us expose the userID in a formula since that would completely negate the need for any JavaScript.