visual hallucations are pretty standard after a certain period of time that isn't even so long. (i.e. I would get them around, say, the 28 hour mark from when I last woke up and started staying up by pulling an all-nighter. So if I get up at 7 every day but then simply not go to sleep one night but try to start the next day - by 11 AM it's hard not to hallucinate. In case you get up later the following is equivalent: If you get up at 11 every morning after calling it a night at 3 am or so, then if one night you don't sleep at all then working past 11 am and on by 3 PM you will be very out of it and may easily hallucinate.)
I'm very skeptical whether there is any amount of productivity to be had what-so-ever as for me, personally, it would easily take me 2 minutes to do 30 seconds of (any kind of) work at the end of that time, even moving a box from one place to another or whatever. So I'm very skeptical how a 3-4 hour nap at 22 hour mark could possibly not make up for lost time after waking up.
going on 3 hours of sleep each night for several days (e.g. 2-3) is possible and easy.
like I said, it would make an interesting thread and someone should submit a story on this subject (sleep deprivation and whether it's even worth working after a certain time mark).
as for your story, it sounds like a simple dream/waking dream. it's really hard to tell dream and non-dream apart under conditions of sleep deprivation.