Is it bad etiquette to keep playing in a clearly hopeless position? Recently I played a blitz game (5m+5s) with an opponent with rating 1500+. I had a clearly losing endgame (K vs KQ). My opponent was not under any time pressure but he made a blunder and the game ended as a stalemate. 

I know this does not happen every day; it is extremely rare that I can draw a clearly losing game, but it may happen say once out of 100 games. If I resign whenever I feel hopeless, my record for these games will be 100 losses; on the other hand, if I keep playing, it could be 1 draw and 99 losses. So my overall record will be slightly better if I never resign; instead, I keep playing until I am checkmated or rarely, the game ends as a draw.

So continuing to play in a clearly losing game seems a reasonable strategy. But it is considered as bad etiquette not to resign when the game is clearly hopeless?
As a general rule, if something is not done out of malice then it's not bad etiquette in my book (especially if it's allowed in the rules). So if all you do is play on in a lost position, then I don't see how anyone could complain; for instance, should a novice not be allowed to play on until checkmate? That would be absurd, no matter who said novice were facing!

The only unsportsmanlike behaviour I've witnessed in this regard was a player in an OTB tournament just sitting and waiting for his clock to run out when the position became hopeless, since his intent was obviously to spite his opponent and waste their time. If he had been making moves I wouldn't even have reacted, but since he was just doing it to annoy his opponent it was a clear act of malice and therefore bad etiquette.