I doubt there has ever been any actual research about this, or if it even could be researched. Any responce is most likely just gonna be speculation and opinion.
My opinion, I doubt they do. A snakes brain probably doesn't function on that level.
If you wanna think it's happening though there is nothing wrong with that. As long as you are just stating its an opinion of yours that your snake does this and don't try to pass it off like it's a fact that the snake does this. It won't hurt anything if you like to daydream your snake is daydreaming.
Who knows maybe the snake is actually laying there dreaming it had a life free from a tank. Most likely not true though IMO.