Section 24A. At trial of a civil matter in the district court department of the trial court, the justice may order, or, upon the request of a party, authorize the taking of a deposition of the testimony of a medical witness. Said deposition shall be taken for use as medical evidence only, and shall be admissible in whole or in part in a proceeding before said district court department. The expense for stenographic service in connection with the taking of such deposition shall be paid by the party requesting that such witness be deposed, or whose witness is ordered to be deposed; provided, however, that if the judgment entered by the district court justice is in favor of the plaintiff, the cost of such stenographic expense shall be added to such judgment and shall be paid by the insurer, if the defendant has insurance, or by the defendant, if he does not have such insurance.