That'll make the JS file load on each and every page. The only limitation here is that it's pure JS and you'll not be able to do any FTL/Soy based processing (like bringing in a system property, i18n or things like that).
First create the js file and save it to your theme. We use lots of jquery so our theme.js file looks like this:
//script to execute
That should be it.
I have a script that was built by a previous developer. It's referencing this file: "/api/core/v3/attachments/file/5891/data"
Where would that be stored/how can I get to it in the admin console?