I think that one of the strongest sacrifices that Proctor makes for the town would be at the trial. In Act III, Proctor understands that the community is going to be made for the worst is Abigail wins. He recognizes her own fraudulence and her own sense of malevolence. To sanction it with a court verdict in her favor only emboldens the aggressors, and with this Proctor sets out to stop her. His admission of adultery, or "lechery," is one sacrifice he makes in order to help his wife and the town of Salem, in general. Another sacrifice Proctor makes to help the town would be at the end. His movement away from a "confession" that has to be signed is something that Proctor sees as a way to give courage to others. Proctor has found his "goodness," as Elizabeth notes, and he does so in the attempt that his children respect the man he is and also for the town to recognize that they have power. In this light, Proctor's ending confession can be seen as more for the town in trying to give them courage to repel the current climate of fear and repression. In these moments, Proctor becomes the example of to which all Salem should aspire in order to cast off the vision that it has become.
After his interrogation, John Proctor refuses to sign the false confession that the leaders have demanded; instead, he maintains his integrity despite the cost of his life.
Although this final heroic act of Proctor's brings about his death, he helps to restore truth. He begins in Act III, Scene 3, as he denounces Abigail as a whore. He informs the court of her machinations meant to induce him to return to her. Proctor confesses his transgression, and he informs Dansforth that Parris caught Abigail and others dancing in the woods, thus raising suspicions in Dansforth enough that he investigates, and Abigail's integrity is re-examined. However, when Abigail is re-questioned, she is able to discredit Mary Warren's testimony of only pretending to be in a trance since Mary is unable to "pretend" against before Judge Hathorne, and Proctor is embarrassed before the court for having brought Mary in to the proceedings.
Finally, however, John Proctor takes his and Elizabeth's sins upon him, confessing his affair with Abigail. This confession provides the court a chance to end the trials. But, because Elizabeth tries to hide the affair, she destroys Proctor's credibility. So, Dansforth then dismisses Proctor's claims against Abigail as Elizabeth has unwittingly lied for him. As a result, Proctor becomes the sacrificial lamb and goes to the gallows.
Nevertheless, John Proctor's death certainly demonstrates that it is more important to die with integrity than it is to compromise one's principles in order to live.