If you google the above question, you will keep running into 'aut in diversorio' but I'm pretty sure this is a machine translation from the book of Kings in the Bible, since that is where the original sentence comes from. I'm guessing "āmissus/perditus in cogitātiōne" (ablative)
Borrowing an expression from Cicero, I would suggest:
Cogitatione alio ductus
Which might be translated:
Led elsewhere (or carried away) in thought
This expression comes from Cicero's De Oratore Ad Quintum Fratrem:
Id accidere credo, vel quod ingeni specimen est quoddam transilire ante pedes posita et alia longe repetita sumere; vel quod is, qui audit, alio ducitur cogitatione neque tamen aberrat, quae maxima est delectatio; (De Oratore Ad Quintum Fratrem Book III, chap. XXXIX, §160)
(I believe this happens, either because it is some indication of intellect to leap over such expressions placed before you and take up others from a greater distance; or because the listener is led elsewhere in thought, while not straying from the subject, which is quite a pleasure.)
In light of cmw's comment, I'm including another possibility suggested by Cicero's same sentence:
Which might be translated as:
Wandering away (or going astray) in thought
Whether one is carried away or wandering away, I believe that both ideas are suggestive of being lost in thought. As cmw pointed out, going astray in thought may be better suited for conveying the idea of being oblivious to one's surroundings.
For the meaning of being consumed in thought so that to lose touch with surrounding, several options might be suggested.
L&S suggests oblivisci sui (literraly: "to forget oneself"), it was suggested by @cmw in a question about distraction resulting in forgetting. However it seems oblivisci sui is wider in meaning than "lost in thought". I believe it is possible to add an ablative of cause/manner to make it clearer, something like "esse oblitus sui (a) cogitatione/cogitando de hac re"; Or, even using present participle esse oblitus sui cogitans de hac re
With respect to the suggested perditus/amissus in cogitatione, it seems to me perditus is a bit stronger and has negative connotation for the sense we seek here; id est, something like perditus (in) cogitatione is likely to get interpreted as "he got ruin/devastated with that thought" - i.e., the thought had negative effect on him. With respect to amissus (in) cogitatione, for time being I could not attest kind of this usage; furthermore in a brief scan, I could not find even one instance of a person as the direct object of amitto in the sense we are seeking, let alone se (with perdo such examples of person direct object can be found that quoted in L&S entry for perdo), hence I would say that amissus (in) cogitatione seems quite off, but I might be missing here.
Another option would be to use captus (lit. taken) instead of perditus, but it has maybe more of the connection of being allured or charmed. L&S lists several examples of this kind of usage like (bos) herbā captus viridi. But if the thing taken is rather animum we might find there:
is ut animum eius cura sacrorum et caerimoniarum cepit (Liv.; he, when his care (of .., )'took' his mind).
So we might have: animus cogitatione caputus or even without animus (cogintatione captus)
Basically integrating animus in the phrase might open some options for us, consider for example this quote from Plinus:
Volō tibi multa alia scrībere, sed tōtus animus in hāc ūnā contemplātiōne dēfixus est (I want to write to you more, but my all being is attached to this one contemplation).
I think it makes good candidate for one who is focused on the thought.
I'll add another one to the list, interestingly from the same book as Expeditio's answer (Cic. Orat. 3.5.17):
in eam exhedram venisse in qua Crassus lectulo posito recubuisset, cumque eum in cogitatione defixum esse sensisset, statim recessisse.
...he came to the hall where Crassus was reclining on a couch set up for him, and when [Cotta] noticed that he [Crassus] was lost in thought, he immediately left.
The participle defixum comes from defigo, which means "to fix, fasten; to turn intently" or even "to stupefy." The idea is that if you're lost in thought, you're blanking out the rest of the world and "and not paying attention to one's surroundings." So Crassus here is thinking about something (in cogitatione) and at the same time oblivious to what's going on around him (which is why Cotta leaves).
(This isn't an answer, but it's too long for a comment.)
"Aut in diversorio" from 1 Kings 18:27 isn't a machine translation, it's the text of the Vulgate. Here's the full verse:
Cumque esset iam meridies, illudebat illis Elias, dicens: Clamate voce maiore: deus enim est, et forsitan loquitur, aut in diversorio est, aut in itinere, aut certe dormit, ut excitetur.
My quick literal translation:
And as it was noon already, Elias mocked them, saying: "Call out with a louder voice: for he is a god, and perhaps he is talking [to someone], or in an inn, or on a journey, or at any rate asleep, that he may be awoken."
Various translators have rendered in diversorio in various ways, with various degrees of plausibility (KJV: "or he is pursuing"; CEB: "or wandering"; ISV: "Maybe he’s relieving himself"). Lewis & Scott say diversorium is a variant of deversorium 'inn, lodging-house', and I deferred to them; the Septuagint, at least, seems not to have an exact corresponding part to shed more light on the intended meaning (I'm not in a position to judge any Hebrew).
I suspect the confusion is due to someone who speaks English but not a lot of Latin. The CEB actually seems to translate loquitur as 'he is lost in thought', which is definitely not tenable and may have contributed.
At any rate, translating idioms word-for-word is not likely to produce good results.