Some ideas on the origin of psychedelic thought loops:
According to pharmacological research, "LSD acts to preferentially inhibit serotonergic cell firing while sparing postsynaptic serotonergic receptors from upregulation/downregulation." Most of the brain's serotonin is produced by neurons that originate in the raphe nuclei (RN), and whose primary target is "the locus coeruleus (LC), which controls the release of norepinephrine, which regulates the sympathetic nervous system. The LC also has neurons that extend into the cerebellum, thalamus, hypothalamus, cerebral cortex, and hippocampus. The RN extends its projections into the brainstem and up into the brain. It has been suggested that neurons in this brain region may inhibit sensation, thus protecting the brain from sensory overload."
This data ostensibly serves as physiological proof of Bergson's theory of consciousness (outlined by Aldous Huxley in
The Doors of Perception), which suggests that although the human mind is capable of experiencing infinity, such a perception is not conducive to everyday survival. Thus, the brain (perhaps through its serotonergic system) serves as a filtering valve that only allows us to experience the perceptive data that it deems practically important at any given moment.
As evidenced by its intimate connection to the amygdala, hippocampus, and other sections of the midbrain, another function of the brain's serotonergic system is to work in conjunction with the midbrain to preserve our continuity of perception. When this continuity is questioned because of a loosening of our "perception valves," we begin to experience the world as a seemingly discontinuous thought loop. Perhaps these loops are our brain's last ditch efforts to make the infinite a finite experience, or perhaps we're being given a glimpse into something transcendent. Either way, I see these loops as reminders that the world does not exist as a continuous, pre-given phenomenon, but rather as an emergent system that is constantly created anew by consciousness (a gradient, as opposed to a polarity, insofar as it is an integral of co-creating wills, our experience of which is thus asymptotic). Thus, as love sex desire eluded to earlier, Atman (individual soul) =Brahman (universal soul).
This might explain, among other things, why those who are predisposed to "mental illnesses and psychoses" often experience these loops negatively. Because their brains are less able (or less willing) to preserve the illusion of continuous, predetermined perception, they are left without any protection from the infinite, and when they fly too close to the sun, they are destroyed. This is not to say that we can't ever experience the infinite, but only that it's an experience that requires deep and extensive preparation (this holds true not only for the poison path, but also for meditation, yogic practice, tantra, etc.)
The full study from which my quotes have been taken may be found here:
http://www.maps.org/research/cluster/psilo-lsd/cns-neuroscience+therapeutics_2008-passie.pdf