Technical Restraining Orders and Injunctions
When you file a suit against your mortgage lender, you usually ask for a technical restraining order, or TRO; a temporary injunction; or a permanent injunction. A TRO postpones foreclosure until you can get a court hearing on an injunction. A temporary injunction delays foreclosure until the judge can give your case a full court hearing. As that may not be for a year or more, it's a big win for you. If you win the case and get a permanent injunction, the lender can't foreclose.
Burden of Proof
To get a TRO, you have to show that you'll suffer serious harm if the foreclosure goes forward. As it will cost you your house, that's a simple standard to meet. A temporary injunction isn't so easy. You have to convince the judge there's a good chance you'll succeed when the case goes to trial. The burden of proof is on you, not the lender. The judge will also weigh the harm to you from the loss of your home against the harm to the lender. To get a permanent injunction, you have to win decisively in court.
Proving the Case
Most preliminary hearings don't involve witnesses. Instead, you submit affidavits stating your version of the facts. If you have witnesses, you include their affidavits as well. The mortgage lender's attorneys will probably submit their own affidavits. Then you have to convince the judge you have a good case. If you can show, for example, that the mortgage lender didn't notify you of the sale far enough in advance, that would violate state law. When the trial rolls around, you bring in witnesses to make the same points under oath.
Winning the Game
If you get a preliminary injunction, the judge may stop foreclosure until the trial. She might also set some condition for the mortgage lender, such as repeating the foreclosure process with proper notification. If your defense is only based on technical errors in the foreclosure, the lender will probably get the house eventually. If you have a substantial defense -- that the lender doesn't actually own the promissory note for your loan, say -- you have a much better shot at getting a permanent injunction.