(a) If the defendant at any time before the judgment causes a bond to be executed to the plaintiff by one (1) or more sufficient sureties, to be approved by the county sheriff, to the effect that the defendant shall perform the judgment of the court, the attachment shall be discharged and restitution made of any property taken under it, or the proceeds thereof. However, the giving of this bond by the defendant shall not preclude his or her right to controvert the existence of the grounds stated by the plaintiff in his or her affidavit for the order of attachment.
(b) The bond may, in vacation, be executed in the presence of the county sheriff having the order of attachment in his or her hands or, after the return of the order, before the clerk, with the same effect upon the attachment as if executed in court. The sureties, in either case, shall be approved by the officer.