Just reading that first link: "If your template uses Ajax loading, some elements, such as the header and footer, won’t need to load each time you visit a page."
Since the code is in the footer, this certainly sounds like the culprit.
Tried it and that fixed it!
This also explains why code that inverts the logo colours on certain pages wouldn't work properly in the header without a refresh. I guess I can move that code back from a regular code block to the header now.
I don't benefit a great deal from Ajax anyway, since my site is pretty minimalist and fast to load. (Except for the Farro-style blog landing page, which will apparently always use Ajax regardless of settings.)
Thank you very much. =)