The order is correct. Regarding the IDs, it depends where you insert your javascript. if on top then clearly you need to use UJS or onReady hooks, if the script is at the bottom of the page then it will see all the page ids from there.
Personally me, I would use CDN, scripts in the head and UJS. If things get too large and _really_ slow down the pages I'd use an async loader.
There is only one case why I would insert scripts in the body, when I need to initialize a complex widget on some element in a loading time. Like say tabs. Normally you have them in onReady hook and there is a slight delay between the page-load and script initialization. So I might insert a little initialization script right below the tabs UL constructions so that they popped up with all the styles right away as if they were there from the beginning.
Everything else can be handled with UJS and have better effect than if you insert your scripts at the bottom, because UJS work right away and there is no delay between the page load and scripts initialization.