(a) A policy of group life insurance or group health insurance or the proceeds thereof payable to the individual insured or to the beneficiary thereunder, shall not be liable, either before or after payment, to be applied by any legal or equitable process to pay any debt or liability of such insured individual or his or her beneficiary or of any other person having a right under the policy.
(b) This section shall not apply to group insurance issued pursuant to this title to a creditor covering his or her debtors to the extent that such proceeds are applied to payment of the obligation for the purpose of which the insurance was so issued.