(a) The proceeds of any sale under § 17-50-406 shall be applied as follows:
(1) To payment of the balance due on any lien preserved by the court in the forfeiture proceedings;
(2) To payment of the costs incurred by the seizing agency in connection with the storage, maintenance, security, and forfeiture of the property;
(3) To payment of the costs incurred by the court;
(4) To payment of the costs incurred by the prosecuting attorney or attorney for the law enforcement agency to which the property is forfeited or to the Commission on Water Well Construction in investigating and developing the case; and
(5) The remaining proceeds shall be equally divided between the commission to be used in furtherance of the commission's activities and the law enforcement agency to which the property is forfeited.
(b) If more than one (1) law enforcement agency is substantially involved in effecting a forfeiture under § 17-50-404, the circuit court having jurisdiction over the forfeiture proceeding shall equitably distribute the law enforcement agency portion of the property among the law enforcement agencies.