Any defendant against whom a decree or judgment shall be rendered for land, where no assessment of damages has been made under the preceding article, may, at any time before the execution of the decree or judgment, present a petition to the court rendering such decree or judgment, stating that he or those under whom he claims, while holding the premises under a title believed by him or them to be good, have made permanent improvements thereon, and praying that he may be allowed for the same the fair and reasonable value thereof; and thereupon the court, if satisfied of the probable truth of the allegation, shall suspend the execution of the judgment or decree, and impanel a jury to fix and assess the damages of the plaintiff (if any) and the value of the improvements (if any) so made by the defendant.