(a) Except as provided in (b) of this section and in AS 21.78.271, a mutual debt or mutual credit between an insurer and another person in connection with an action or proceeding under this chapter shall be set off, and only the balance may be allowed or paid.
(b) A setoff or counterclaim may not be allowed in favor of a person if the obligation of the
(1) insurer to the person would not, at the date of the filing of a petition for liquidation, entitle the person to share as a claimant in the assets of the insurer;
(2) insurer to the person was purchased by or transferred to the person with a view to its being used as a setoff;
(3) person is to pay an assessment levied against the members or subscribers of the insurer, or is to pay a balance upon a subscription to the capital stock of the insurer, or is in any other way in the nature of a capital contribution; or
(4) person is to pay premiums, whether earned or unearned, to the insurer.