It usually has to be returned as a core to the place the replacement engine comes from. So ask about your core charge if you were charged one or not. Then if not the old scrap engine is technically yours. Most mechanics will keep them and add them to their own scrap piles.
Not worth much on your own then sometimes hauling to a scrap yard can be a pain.
That’s high I would get a good used one from LKQ or similar and swap it myself. Probably save 600-700$ bucks