(a) Where property is levied upon under any process of law by an officer and taken into possession, and an action is brought against the officer for the recovery of the property or for damages, any person at whose instance the process issued may be permitted to come into court at any time before the cause is finally disposed of and be substituted as defendant in the place of the officer, of which an entry shall be made upon the minutes of the court.
(b) The party so substituted may, in the discretion of the court, be compelled to assume and give security for all costs that have or may become chargeable to the officer up to the time of the substitution.
(c) Upon the substitution, the officer shall no longer be a party to the suit but shall be a competent witness in the suit.