This is a great moment in the drama. John Proctor is trying to bolster an obviously weakened Mary Warren. For a girl who is terrified of betraying the "Queen Bee" of Abigail and the rest of her "Mean Girls," it makes sense that Mary Warren's appearance in court is one of being weak and discombobulated at the task in front of her. Even Judge Danforth, who is not one for understanding, remarks that "She's not hearty, I see" at the sight of Mary Warren. Proctor's words at this point of the angel Raphael are meant to comfort and guide Mary in a most difficult time. The words are meant to help Mary.
If they are deconstructed, one can see the reason Miller employs their use. The idea "doing good" is something that has been so very lost in Salem at the time. Proctor's hope in using them is to invoke some level of moral guidance in a setting where there is no moral structure or guidance apparent or available. Additionally, the idea of "doing good" and "no harm will come to thee" is something that Mary starts out believing. Yet, when Abigail and the other girls gang up on her and torment her with exclusion and intimidation, Mary capitulates and turns on Proctor in order to be with "the group." The idea that "no harm will come to thee" is in recognition of doing right by Abigail, the individual who has the power in this scene. Proctor's attempts to use the words in the hopes of establishing morality and justice are in vain, just as his confession in the hope of stopping the madness of the trial is futile.
The final point in the use of the angel Raphael's words is the very essence of defining "that which is good." In the courtroom setting, this becomes very difficult to decide for different people. For instance, Hale tries to protest the manner of the proceedings, but is silenced and simply takes it rather than doing something more forceful about it. By the end of the play, one has to wonder if this represents "Do that which is good." Elizabeth is tossed into the fire in the midst of the court proceedings. In her defense of her husband, she lies to try to save him. Seeing what awaits both she and her husband at the end of the play, one has to question if what she did represented, "Do that which is good." Finally, Giles Corey refuses to name names and Francis' names on the petition becomes the source of new enquiries for the court. In this, one has to wonder what they thought in terms of if they did "that which is good." The entire court proceedings, where justice has been inverted for personal gain, and the search for truth is illusory, help to establish a certain amount of hollowness in the angel's words that Proctor turns to for comfort in a time of distress.