(a)  General rule.–If the plaintiff spouse becomes the purchaser at the execution sale, the plaintiff shall be entitled to a credit on the purchase price thereof for the sum of money found by the court to represent the plaintiff’s share in the property and also for the sums of money due the plaintiff from the defendant under the order of support upon which the execution was issued at the time of the sale, together with interest on the sums due the plaintiff for support from the time the respective sums become due.

(b)  Allowance or assignment of credit.–The credit shall be allowed the plaintiff by the sheriff or the plaintiff may assign the sums due the plaintiff to the purchaser of the property whereupon credit shall be given to the purchaser by the sheriff for the amount assigned.