I've finally worked my way through Jasper Fforde's "Thursday Next" series to get to the one I've wanted. Something Rotten has Hamlet as a main character. For those not familiar with the plot of these novels they involve a rather odd sort of literary / scifi combo where detectives are charged with "bookjumping" themselves from reality right into the text of a book to prevent people from doing things like kidnapping characters, changing the ending, and so on. It's really quite imaginative stuff. Throughout the series he has always stayed near the edges of Shakespeare - in book one, for instance, he introduces the notion of the Baconians as crazies who come door to door trying to convince people who the real author of Shakespeare's works is :). And a later book (I think it was the second) is entirely centered around someone who claims to have found the text to the infamous lost work, Cardenio. I believe at one point someone is even arrested for the crime of overdramatically portraying Richard III.
But this time Hamlet is an actual character in the play. And he has hopped out of the play and into reality. I've just started the book, but already I like it. One of Hamlet's first actual pieces of dialogue is to explain how he wants to talk to people about what they think of him and his motivations, because he himself is confused. He gives the example that he's supposed to be oh so very religious, but then he comes out with a line like "for there is nothing either good or bad, but thinking makes it so," which Hamlet points out is a pretty atheistic thing to say.
Man's got a point. I'm anxious to see how this one goes. I wish I'd found it on audiobook, I'd get through it much faster, but I'll take what I can get.