I don't care if you believe me. I cannot prove it, so I won't lose sleep if you think I made it up. For me, its enough that I witnessed it.
Having said that, I obviously simplified the story and I have a pretty good theory of how he came up with the solution (since I now know the guy a lot better). I actually think he has a very very slight case of autism (never diagnosed, but over the years, there have been some hints that it may be the case). I of course don't believe that a woman actually told him the solution, I think the autism is what helped him come up with it (since properly autistic people are able to do some amazing things) and the drug made him trip out and believe a woman spoke to him.
As for not believing that somebody could do things on Salvia, I disagree. Normally I don't like to admit to drug use on the internet (since its easy to figure out who I am), but what the hell. Maybe I'll come to regret it later... While I haven't taken any in a few years, I have taken Salvia many times over the past ten-ish years (and I took it that night with my friend too). I have taken it in the middle of the day, in the sun. I have taken it at night, in a dark room. I have taken it at a party (despite people saying its not a party drug). Each time the experience was very very different. It depends on your surroundings and on your mood. Yes, salvia is extremely intense and gives a very disconnected experience, but I think the actual extent depends on the factors I mentioned above. For example, every time I took it at night, it was a very weird and "heavy" experience, but when I took it in the sun, it was a bright and happy (almost mdma-like) experience.
I don't know if you get this on Salvia, but most people I have spoken to about it have said they experienced something similar. When on Salvia, theres this feeling of "pressure" pulling you into the experience (often its a feeling of something pushing or pulling you some direction, perhaps spinning around, falling or weightlessness). I've got this every time (that I remember, there may have been times when I didn't that I don't remember). Every time I've tried to resist it and go against it, I broke out in heavy sweats. When we did the programming problem, it took a LOT of effort to resist it to write in the notepad. After a few minutes, I gave in and forgot about the notepad (skin soaked with sweat). I guess my friend was able to resist it more than I was. But. honestly, I don't remember the exact details, nor do I remember anything about the trip I had or what I wrote in my own notepad, since my friends was much more interesting and this happened maybe five or six years ago.
My point is that it is hard to resist it, but its not impossible (at least, for a while) and while resisting it, you can be tripping and still do things (well, kind of). But, at the end of the day, if you don't believe me, thats fine. Maybe you can try it for yourself? Just be aware that (in my experience) there will be an intense "pressure" pulling you away from what you're trying to do and you may have to try pretty hard to resist it.