Studies have found snakes have a capacity to learn. Individuals will also act differently than one another, and generalizations of species (african rocks and bloods supposedly being aggressive or all balls being docile, for example) have been shown to be false on several occasions. I'm of the opinion reptiles in general are just a few steps short of birds. (do note that birds, as well as other reptiles, do not have the same brain structures of mammals, however, they're capable of some of the same thought processes, tasks and emotions)
Temperature also plays a very important part in their mental capabilities as well; warmth causing quicker learning.

However, one thing does not change, and that's just how simple a snake 'wants' to live its life. All their mental capabilities are geared towards doing just that. They can remember things for months, if not potentially years, however, that specific thing they're remembering is where that nice cozy den is and how to get there, or what trail those delicious rats are cruising along every night so they can ambush them.
I also think the notion that snakes go towards people or wrap around them because people are warm is false. Not because I believe they're showing affection towards people, but simply because they don't always like being warm in the first place, and they can overheat. The best sort of mental stimulation, if any, that you could give to a snake is probably an occasional chance to explore, as it seems as if their minds are geared specifically towards doing that according to the way studies make it look. New smells, different water holes, new dark places, even tracking a scent trail of a dead mouse across the living room. (there's a video out there on the youtubes of one person who did just that)
It's also worth noting that snakes' closest relatives, phylogenetically speaking, are iguanids, agamids, and monitors, all of which are some of the smartest known reptiles there are.

A snake will never compare to a dog or even a cat with how much they want to spend time with a person, but I wouldn't put individual recognition beyond them, and it's possible for them to recognize and trust a specific individual human more than any other human. That is, of course, granted that snake doesn't already hate all humans in the first place.


Overall though, it's still a very muddy topic with the science still in its infancy. The best way to find out with what we have now is to collect a bunch of different snakes yourself, and to observe and interact with them often by yourself, therefor coming up with your own conclusion.