(5) Before any unauthorized foreign or alien company shall file or cause to be filed any pleading in any action or proceeding, including any arbitration, instituted against it, such unauthorized company shall either (1) deposit with the clerk of the court in which such action or proceeding is pending or with the clerk of the court in the jurisdiction in which the arbitration is pending cash or securities or file with such clerk a bond with good and sufficient sureties, to be approved by the court, in an amount to be fixed by the court sufficient to secure the payment of any final judgment which may be rendered in such action, proceeding, or arbitration; or (2) where the unauthorized company continues to transact the business of insurance by issuing new contracts of insurance or reinsurance, procure a certificate of authority to transact the business of insurance in this State. The court in any action or proceeding, in which service is made in the manner provided in subsections (3) or (4) may, in its discretion, order such postponement as may be necessary to afford the defendant reasonable opportunity to comply with the provisions of this subsection and to defend such action.
Nothing in this Section is to be construed to prevent an unauthorized foreign or alien company from filing a motion to quash process or to set aside service thereof made in the manner provided in subsections (3) or (4) on the ground either (a) that such unauthorized company has not done any of the acts enumerated in subsection (2) or (b) that the person on whom service was made pursuant to subsection (4) was not doing any of the acts therein enumerated.