This should be done to reduce HTTP requests. Also, if scripts are included inconcatenating them is key, because multiple scripts have a blocking behavior.
IDs must be unique to an HTML document.
To benefit from common scripts cached by browsers, you should use the Google Library APIs whenever possible. As an example, over 85% of sites use JQuery, and this 20K-ish script does not need to be re-downloaded for every single site.
However, always have a local fallback when linking external scripts that may be included locally.