Enqueueing Scripts/Styles mid-page

Using wp_enqueue_* ‘in the body of the page’ (by which I really mean inside widget or shortocde callbacks) is an excellent way to ensure that scripts/styles are only loaded when they are needed (i.e. when the shortcode/widget is actually present on the page).

Script/Styles Location

Scripts and styles are then loaded either in the header (if enqueued before the page starts being generated), or else in the footer. So you only need to check two places to see if a script has loaded.

Dependencies

WordPress handles these. As mentioned, scripts and styles are printed in one of two places. If you enqueue a script ‘in-line’, it won’t be printed inline, but in the footer. Before doing so WordPress loads any dependencies that haven’t already been loaded in the header.

Decentralised script handling

You should register your all scripts on the wp_enqueue_scripts hook. Then all handling of all your scripts lie in one place (script location, version, dependecies etc). The only thing you should do elsewhere is enqueue them, and it’s much easier to do this by enqueuing them in-line than performing convoluted, and maybe expensive, checks in one place.