At least one chunk of that code is used for the ajax
callbacks for Instant Search.
Also, when you consider whether inlining Javascript is bad, you should think about the alternative. If the code was in a separate file, it would be another http
request, which means that the page would load with higher latency.