Ah yes, with the focus on Chapter 20, the "wicked impulses" you mention in your question are some of my favorite passages to teach from Hawthorne's novel! Most importantly, you should realize that there are precisely three temptations: blasphemy, lies (in regards to the mortality of the soul), and impure thoughts. Dimmesdale resists these temptations, effectively making him a graphic Christ Figure in The Scarlet Letter.
Just as Christ turned from the three temptations by the devil in the desert, Dimmesdale turns from the three temptations the devil provides for him. First, Dimmesdale meets an aging deacon of the church:
It was only by the most careful self-control that the former could refrain from uttering certain blasphemous suggestions that rose into his mind, respecting the communion supper. (205).
Blasphemy against the reverence of the communion supper! Can you think of a worse thing for a Puritan to think!?! Here is a holy act that Jesus himself instituted via the Bible, . . . and Dimmesdale can think of nothing but slandering the Lord. Secondly, Dimmesdale meets an aging woman of the congregation who loves nothing more than to hear the truths of scripture from her pastor. However, Dimmesdale can think of naught but lies:
As the great enemy of souls would have it, could recall no text of Scripture, nor aught else, except a brief, pithy,and, as it then appeared to him, unanswerable argument against the immortality of the human soul. (206)
Belief that the soul is mortal would nix the entire Puritan religion! Oh how sorely disturbed Dimmesdale must be by this point! Then comes the last temptation, the temptation of a young virgin:
As she drew nigh, the archfiend whispered him to condense into small compass and drop into her tender bosom a germ of evil that would be sure to blossom darkly soon, and bear black fruit betimes. (207)
Luckily, Dimmesdale draws his cloak over his face and celebrates his "victory over this last temptation." Why does Hawthorne call it the "last temptation" when there are obviously two more things that happen on the way to town? Because these first three are the only ones that come directly from the devil, thus making Dimmesdale a Christ Figure.
Poor Dimmesdale then has an intense desire to shake the hand of a drunken sailor, . . . and runs into the local witch (Mistress Hibbins) who smiles at him with great wisdom. I suppose I could think of some kind of descriptive term at this point, but there can be no better words than of Hawthorne himself: "The wretched minister!"