This is where while I've never read the books, if I rationalize things out and just happen by chance to hit the answer, is that considered a spoiler?
No, but it makes him the least likely suspect. He's never been shown as anything other than a monumental screw-up. It would be a deus ex machina moment if he suddenly got his act together well enough to plot the murder of a king. I think he's just a drunk who is smitten with Sansa, not a co-conspirator. If he was involved in any way it would be more reasonable to believe that he's an unwitting patsy being used by somebody more intelligent in case something went wrong.
If that blue gem taken off the necklace is indeed what killed Joffrey, there are easier ways to have placed poison in the cup, the only benefit to the scheme is you can easily point to Sansa wearing a necklace full of poisonous gems and one missing, as the guilty one to be punished.
If he was in on the plot he wouldn't have helped Sansa get away from the scene. So, more likely he was being used to pass along a necklace with a fake story, then noticed the one stone missing during the wedding and pieced together she was being framed.
Drunks may be drunks, but they can be remarkably perceptive on occasion.