In Dutch, we have a a saying. It's not really a saying, but it's that word I spell so bad even Google won't risk guessing what I mean. Here's the Dutch: "Zijn gedachten namen een loopje met hem." Here's the literal translation: "His thoughts took a walk with him." In the story: The character sees a woman produce a pack of cigarettes from the pocket of some very tight shorts, so his mind just starts making up that the pack is coming from another dimension (trust me, in context it's actually funny... ish), because no way there's room for them in this one. I was going to write: "His mind took a run with him." It sounds like it could be a saying of sorts, but clearly written by someone who heard it in passing and doesn't speak enough English anymore to recall it. This won't do, obviously. I can write around it, no problem, but is there a saying, or (let's try again) colloliqui (dammit) one would use when someone's brain goes and does their own thing in an unguarded moment? Bonus question: Is there a website that deals with translating saying, or getting one language's version of another language's saying? Seems like something someone would spend free time on, and this won't be the last time I run into this issue, I'm sure.
Colloquialism. You might be looking for "His thoughts ran away with him." Or maybe something like "His thoughts began to wander along some strange paths."
You could also say "His thoughts ran wild" or "his imagination ran wild" but that's often used for some meandering or uncontrollable thoughts, so not sure if it's appropriate.
The man is confronted by a woman barely dressed in tight shorts. His thoughts are running wild, don't worry. ;o)