The court in which the action or special proceeding was commenced may, in its discretion and at any time after the action or special proceeding shall be settled, discontinued or abated as provided in §§ 15-5-180 and 15-5-190, on application of any person aggrieved and on good cause shown and on such notice as shall be directed or approved by the court, order the notice authorized by § 29-3-400 to be cancelled of record by the clerk of the court of common pleas of any county in whose office it may have been indexed and such cancellation shall be made by an endorsement to that effect on the margin of the index of the record, which shall refer to the order for cancellation.