If the commission, Commonwealth Court or the Supreme Court issues an order that a local ordinance violates the MPC, this chapter or Chapter 32 (relating to development), the municipality enacting or enforcing the local ordinance shall be immediately ineligible to receive any funds collected under Chapter 23 (relating to unconventional gas well fee). The local government shall remain ineligible to receive funds under Chapter 23 until the local government amends or repeals its ordinance in accordance with this chapter or the order or determination that the local ordinance is unlawful is reversed on appeal.