"A sense of humor keen enough to show a man his own absurdities will keep him from the commission of all sins, or nearly all, save those that are worth committing."
How does this quotation relate to "The Importance of Being Earnest"?
This quote seems like something Algernon would say. He is the most witty of the characters in the play, and has a fun, yet devilish side to his personality. He likes to keep things interesting by being a "bad boy" and by getting away from all his responsibilities with, what he calls, Bunburying. Bunbury is his imaginary friend -- a very sickly guy-- who lives in the country and who needs assistance from Algernon from time to time.
Algernon certainly has a sense of humor and a very clear understanding of verbal, situational, and dramatic irony. I think he understands his own absurdities -- he does some rather brash things for the sake of his own amusement. Where the quote gets complicated, and seems very "Algernon-like" is the twist of the second half of it. The quote says that if you can see your faults, you can avoid them -- which is true! But Algernon doesn't want to avoid them -- hence the tag on the line. Algernon would say that most of his faults are worth committing because they keep him entertained and amused.