(1) The court may refuse to make a * restraining order if the Commonwealth refuses or fails to give the court an appropriate undertaking with respect to the payment of damages or costs, or both, for the making and operation of the order.
(2) The * responsible authority may give such an undertaking on behalf of the Commonwealth.