(a) Motion to Discharge Before Trial. The defendant may attack an arrest made under a writ of ne exeat or capias ad respondendum by a motion to discharge on such short notice as the court directs. Upon such motion the court shall determine the sufficiency, in fact and law, of the proof upon which the writ was issued, the plaintiff bearing the burden of proof. The defendant may cause the testimony of any person to be taken either before the court on the hearing of the motion or as provided in these rules for the taking of depositions. The court, if satisfied that the writ should not have issued, shall upon terms make such order for defendant's discharge and the discharge of the bail or bond, if any, as the circumstances require. If the writ was issued as original process, however, the action shall not abate but shall, unless otherwise ordered by the court, proceed as if commenced by summons.
(b) Discharge at Trial. If a defendant has been held to bail or bond and on the trial the court is satisfied that the writ should not have issued it may make a like order of discharge.