@PHPst: well, invalid code may be subject to side effects in certain browsers. Either way, I don't see how its indentation being one tab-width less than the code above it makes it look any cleaner.
@epalla: if you put the script right at the end of the body tag there's no other content left to load by the time it gets there, so there should be little difference between placing it outside or just inside. You then have the added benefit of your page still validating, which was the point I was trying to make in my answer.
It won't validate outside of the <body> or <head> tags. It also won't make much difference unless you're doing DOM manipulations that could break IE before the body element is fully loaded to putting it just before the closing </body>.
Yep, I was agreeing with you since your answer is good. I just wanted to add that there is a reason for putting JS at the bottom of the page instead of in the head as we've done for a long time.