The "good work" the judge refers to is the fact that Hale is counseling with those who have been arrested...
Hale's role in Act lV is made clear by Judge Danforth when he says:
Accept my congratulations, Reverend Hale; we are gladdened to see you returned to your good work.
The "good work" the judge refers to is the fact that Hale is counseling with those who have been arrested and is trying to persuade them to confess. This much was confirmed earlier by reverend Parris:
Now Mr. Hale's returned, there is hope, I think--for if he bring even one of these to God, that confession surely damns the others in the public eye, and none may doubt more that they are all linked to Hell.
Hale has not achieved much success in this regard and asks Judge Danforth to pardon them since "they will not budge." The request is rejected.
That Judge Danforth mentions that Hale has "returned" is a reference to the conclusion of Act Three when Reverend Hale, in a fit of anger and outrage, denounced the proceedings of the court and stated that he would no longer have any part in them. He walked out of the courtroom, slamming the door behind him.
Furthermore, Hale has clearly become much more of an adviser to the court in an effort not only to save the lives of those whom he clearly believes are innocent but to also ensure the peace and security of the village and the entire province.
The above indicates an obvious and dramatic change in Hale's attitude. Prior to his outburst at the end of Act lll, he was determined to find the Devil in Salem and root him out. He firmly believed that many had been involved and was skeptical about the innocence of the accused. He, much like the rest of the court, firmly believed that the girls were acting as God's agents and were innocent of any wrongdoing.
However, after he had heard John Proctor's dramatic confession about his affair with Abigail and Mary Warren's own turnaround when she was pressured by the actions of the other girls and accused John Proctor of doing the Devil's work, he realized that the girls were malicious liars. The court had been their puppet and he wanted nothing more to do with the proceedings and condemned them.
The text informs us that on his return:
He is steeped in sorrow, exhausted, and more direct than he ever was.
It is easy to notice Hale's change. He has been overwhelmed by the depth of malice and what he believes is the court's stubborn foolishness to see things for what they really are. He also experiences profound guilt for the role he has played in the execution of so many accused at this stage of events and states that there is blood on his head. Throughout Act lV, he consistently strives to make the court see reason. He mentions the threat of rebellion and refers to the confusion and chaos that have overtaken Salem.
Excellency, there are orphans wandering from house to house; abandoned cattle bellow on the highroads, the stink of rotting crops hangs everywhere, and no man knows when the harlots' cry will end his life - and you wonder yet if rebellion's spoke? Better you should marvel how they do not burn your province!
It is evident that the reverend is desperate and more outspoken. He plainly does not show the court the respect he had before. It is his sole purpose to bring to an end the slaughter of innocent citizens. He has become deeply immersed in fighting on behalf of those who have been accused and he is clearly sarcastic when Judge Danforth asks him why he returned to court.
Why, it is all simple. I come to do the Devil's work. I come to counsel Christians they should belie themselves.
It is tragically ironic that Reverend Hale's best efforts come to naught for, in the end, John Proctor, Rebecca Nurse, Martha Corey and other innocents are hanged for crimes they did not commit. The odds against the reverend were just too great--he had to deal with an arrogant, recalcitrant judge; a materialistic, fearful priest; ignorance and gullibility; and most importantly superstition and an irrational fear of the unknown.