If a charitable purpose of a charitable trust becomes unlawful, impracticable, impossible to achieve, or wasteful, the court shall, upon a petition by a donor or other interested person pursuant to this Code section, modify or terminate the trust in such a way as will as nearly as possible effectuate the intention of the settlor or donor.