Notwithstanding any provision of the agreement on detainers to the contrary, in a case in which the United States is a receiving State—
(1) any order of a court dismissing any indictment, information, or complaint may be with or without prejudice. In determining whether to dismiss the case with or without prejudice, the court shall consider, among others, each of the following factors: The seriousness of the offense; the facts and circumstances of the case which led to the dismissal; and the impact of a reprosecution on the administration of the agreement on detainers and on the administration of justice; and
(2) it shall not be a violation of the agreement on detainers if prior to trial the prisoner is returned to the custody of the sending State pursuant to an order of the appropriate court issued after reasonable notice to the prisoner and the United States and an opportunity for a hearing.