But I think if you are in the throes of a problem, pondering it constantly, day and night—it is in these times that an insight will make its way to your consciousness (drugs or otherwise).
Weirdly I often have dreams where I am 'solving' some problem, however on waking I realise the details are nonsense - not just the solution, but the problem itself. I think dreams are often a way to just exercise and sort memories and ideas. There is no reasoning involved.
A lot of science is just process, or multiple careful experimentation. Preparing for getting lucky is another matter.
https://www.newtonproject.ox.ac.uk/view/texts/normalized/OTH...
> after dinner, the weather being warm, we went into the garden, & drank thea under the shade of some appletrees, only he, & myself. amidst other discourse, he told me, he was just in the same situation, as when formerly, the notion of gravitation came into his mind. "why should that apple always descend perpendicularly to the ground," thought he to him self: occasion'd by the fall of an apple, as he sat in a comtemplative mood: "why should it not go sideways, or upwards? but constantly to the earths centre? assuredly, the reason is, that the earth draws it. there must be a drawing power in matter. & the sum of the drawing power in the matter of the earth must be in the earths center, not in any side of the earth. therefore dos this apple fall perpendicularly, or toward the center. if matter thus draws matter; it must be in proportion of its quantity. therefore the apple draws the earth, as well as the earth draws the apple."
When I woke up the next day, I compiled it, ran it, and it worked on the first try (up to the stack limit on my computer... 6 function calls deep).
Since then I've noticed that if I get super-duper obsessive about things I don't understand, insights will start to pop into my head, but at the same time, I can't really talk to other people because the human interaction part of my brain is "paged out". I kind of understand tormented geniuses better knowing that many of them also walk a fine line between human life and discovery.