(a) Except as provided in subsection (e) of this section, the court may grant a stay of the proceedings brought pursuant to this subtitle upon motion of defendant made upon notice to all parties and to the Attorney General whether or not a party whenever there is pending any of the following at the time of commencement of an action brought pursuant to this subtitle:
(1) Any administrative enforcement hearing initiated by an agency of the State or a political subdivision, either prior to or after receipt of the statutory notice required by § 1-505(b) and (c) of this subtitle, with jurisdiction by law over the condition or activity complained of, if the proceeding is being diligently prosecuted in the opinion of the court;
(2) Judicial review of any administrative action taken with respect to the condition or activity complained of;
(3) An action in court brought by the Attorney General on behalf of a State agency represented by him or by a political subdivision of the State with respect to the condition or activity complained of; or
(4) An appeal from a judgment rendered with respect to an action brought under item (3) of this subsection.
(b) Except as provided in subsection (e) of this section, the court also may grant the stay provided for in subsection (a) of this section upon motion made by the Attorney General on behalf of the people of the State or by a State agency or official represented by him, whether or not he is a named party defendant.
(c) A stay shall be granted for a time the court considers reasonable for completion of the administrative or judicial proceeding, the pendency of which is the basis for the motion for the stay, but in no event may a stay be granted for longer than 90 days without a showing of sufficient cause by the defendant or the Attorney General.
(d) The court, upon motion demonstrating sufficient cause, may grant extensions of the stay for additional periods not to exceed 90 days each.
(e) A stay pursuant to this section may not be granted if the court finds that the condition or activity complained of either presents an imminent danger to the health, welfare, or safety of the people of the State or results in, or is likely to result in, irreversible or irreparable damage to the air, water, or other natural resources of the State except pursuant to § 1-504(f)(2) of this subtitle.