In "Study in Pink", the killer wants Sherlock to play the game with the pills, betting on the fact that for Sherlock being right is even more valuable that being alive. The killer uses this incentive to force Sherlock to swallow the pills from the bottle Sherlock has chosen. Although Sherlock may indeed value his life less than his rightfulness, I don't think he really wants to bet his life in case there are other ways to check whether he was right or not.
For example, he could call the police to catch the killer, collect both bottles remembering his choice and check the pills say with chemical analysis or mice in the worst case. Unless I'm missing something, by no means this is something impossible. Instead, Sherlock chooses to risk his life. The only reason for the latter that comes to my mind is: Sherlock shows off that he is so sure that he doesn't think he risks anything. However, this seems to be a pretty weak reason - especially taking into account that the killer says that there is somebody beyond him (Moriarty), and hence why would Sherlock show off himself in front of this killer, knowing that the latter is just a pawn of Moriarty.