Worf has always been shown to have his own vision of what honor truly means, that is not always necessarily in line with traditional cultural Klingon views (though often is) - and often goes against Klingon politics. He has also been shown to occasionally accept a more 'human' pragmatist's path to solving some problems. So right off the bat we can presume that Worf has a pre-existing disposition to not be honorable 'by the book', as it were. On top of which Jadzia, who Worf is clearly attracted to, is pressuring him to help.
It's not difficult to justify his actions as honorable, especially when one takes into consideration his more pragmatic 'human' moments; helping a comrade out of a situation where his only options are death, or humiliation. Additionally, as laid out in the other answer, Quark is IN this situation due to Worf in the first place.
I think it's also worth noting that if Quark were a Klingon, I think Worf would be far LESS willing to help if it were requested; a Klingon warrior could give Thopok a good fight and WOULD be bound by Klingon honor, but Quark stands no chance, and everyone involved knows it, on top of which he's not even part of that culture.
Now, all of the above might seem to be in conflict with the OTHER thing Worf does in this episode that you mentioned, for no reason other than 'tradition demands', but I don't think so. With the above, Worf has his own experiences to rely on, his own history among both Klingons and humans to tell him that the honorable path isn't always the one defined by tradition. But where romance is concerned, Worf has very little experience. It's not surprising or out of character that when presented with a new situation he has very little experience with, he would 'fall back' to traditional Klingon values for lack of anything else.