(a) This section applies only to an obligation that:
(1) is on real or personal property that is owned by a person when the person becomes a person in emergency management service or person suffering injury or damage;
(2) originates before the person became a person in emergency management service or person suffering injury or damage; and
(3) is secured by a mortgage, deed of trust, or other security in the nature of a mortgage.
(b) (1) In a proceeding in a court against a person in emergency management service or person suffering injury or damage to enforce an obligation subject to this section arising out of the nonpayment of a sum due under the obligation or arising out of a breach of the obligation that occurs before or during the period that the person is a person in emergency management service or person suffering injury or damage:
(i) on its own initiative the court, after hearing, may stay the proceeding or otherwise dispose of the case as it considers equitable to preserve the interests of the parties; and
(ii) except as provided in § 14-215 of this subtitle, on motion by a person in emergency management service, person suffering injury or damage, or another person acting on behalf of that person, the court shall stay the proceeding or otherwise dispose of the case as it considers equitable to preserve the interests of the parties.
(2) The court need not stay the proceeding if the court finds that the ability of the defendant to comply with the terms of the obligation was not materially affected because the defendant was a person in emergency management service or person suffering injury or damage.
(c) Except on an order of sale previously granted by a court and a return to the order made and approved by the court, a sale under a power of sale or under a judgment entered on a confession of judgment contained in an obligation subject to this section is not valid if made during the period that the person who owns the property is, or within 3 months after the person ceased to be, a person in emergency management service or person suffering injury or damage.