Sherlock Holmes is mostly very serious throughout his interview with Helen Stoner. He tells her at the outset:
"You must not fear. We shall soon set matters right, I have no doubt."
When she begins her story, he says:
"I am all attention, madam."
Throughout her long explanation of her problem, Holmes interjects serious questions and comments, such as:
"Pray be precise as to details."
"One moment, are you sure about this whistle and metallic sound? Could you swear to it?"
"These are very deep waters."
"You have been cruelly used."
"This is a very deep business....Yet we have not a moment to lose."
Later when Dr. Roylott bursts into his room and threatens him, Holmes treats this dangerous man with sarcasm and contempt. But this does not mean he is the least bit amused or lighthearted. He fully realizes that he is dealing with a violent man who is not entirely sane. This is just Holmes' way of dealing with men who threaten him. He tells Roylott:
"Your conversation is most entertaining. When you go out close the door, for there is a decided draught."
This is not a bad way to deal with men who threaten violence. If Holmes were to provoke Roylott with counter-threats, the encounter would undoubtedly escalate into actual violence, and Holmes has nothing to gain from fighting with this man. "A soft answer turneth away wrath, but grievous words stir up anger," as the Bible says.
After Roylott leaves, Holmes tells Watson:
"This incident gives zest to our investigation, however..."
The author's purpose in introducing Dr. Roylott at this time and in this manner seems to have been precisely to give "zest" to the story, to make it more dramatic than it would have otherwise been. Dr. Roylott does not reappear until the very end, but his menacing figure lurks in the background until Holmes and Watson find him dead.