A defendant may appear at the rule day at which the process against him is returnable, or, if it be returnable in term, at the first rule day after the return day, and, if the declaration or bill be not then filed, may give a rule for the plaintiff to file the same. If the plaintiff fail to do this at the succeeding rule day, or shall, at any time after the defendant's appearance, fail to prosecute his suit, he shall be nonsuited and pay to the defendant, besides his costs, $5.