As you can see in the scene, John Proctor is in the court. His purpose is to confess what Abigail told him: her dancing was not related to witchcraft. With this confession, Elizabeth wants John to speak in court about the accusations being fake.
After seeing that Proctor is in court to testify, one question comes to the mind of the reader: Why does he risks himself and do this?
The previous question can be answered when interpreting the quote "I will fall like an ocean on that court".This quote is important, since it shows that Proctor will do anything to help and save his wife.
Even though he betrays her influenced by lust, he decides to show his loyalty in court. This is also an example of how people in the story act influenced by their emotions. When John decides to testify, knowing that his affair with Abigail would be known, he choses his affection towards Elizabeth instead of his image.
In conclusion, John in court testifying in order to defend Elizabeth demonstrates his loyalty to her, even though he makes the mistake to have an affair. It is also important to mention that his strong emotional connection with his lovely wife influences this act of risking himself to protect her.