I was looking at the jQuery UI code, and I found that every file starts with a construct like this:
jQuery.ui || (function($) {
My question
I think the logical OR is being done to allow for the file to be included (and evaluated) multiple times, and not clobber itself: If you load it again, jQuery.ui will be already defined, and it will not do anything.
The file could be included multiple times by mistake if someone has lost track of script tags.
As for the semicolon, I can only guess that this is a safeguard to make sure that the file also works if included in another file, even if the last statement there is not terminated by a semicolon.
A spurious semicolon does not do harm, a missing semicolon might.