What's most important to note here is the capital "D" in Dane. Hamlet is not merely referring to himself as a citizen of Denmark, but as The Citizen of Denmark--i.e., the rightful king. We have heard Hamlet mull his future, his past, his place in the world, and his thoughts on the afterlife. Just moments prior to this rash declaration, he philosophized on the fleetingness of life and worldly status as he mentions that even Alexander the Great (or what is left of him) could now be part of a cork stopping a barrel. But, despite all that we've heard Hamlet's thoughts on to this point, we haven't really heard anything about whether or not he wants to be King...except for his wry comment to Rosencrantz and Guildenstern in 3.2 when he states he "lacks advancement." This is an oblique commentary on his royal status (or lack of). But here, in 5.1, he recklessly jumps forward, filled with rage at Laertes, and declares himself the rightful King.
Why does he choose to do so now? Perhaps his rage alone propels him to admit this deeply held thought. Perhaps, since he is so bent on showing Laertes that he loved Ophelia more, he feels he can "one-up" Laertes even more by identifying himself as royalty. He then follows up this bold, public statement by mentioning to Horatio in 5.2 how Claudius "popped in between th' election and my hopes," indicating that he was, indeed, hoping to be elected as King.
This begs the larger question: WAS Hamlet solely motivated to kill Claudius just to avenge his father's death? Or did he have some selfish motives as well (knowing that he would be the shoo-in for King if Claudius weren't around anymore...)?