the engine blew, that sucks but it happens. its a mass produced car that maybe on nut or bolt didnt get tightened on and it blew. yea it sucks but again it happens. From what you said the dealership is doing what they are supposed to do replace the engine. i dont know what more you want. you have a car that is under warranty and they are fixing a problem with it that is clearly covered.
i dont know how much a factory replaced engine will actually devalue your car. im sure jsut driving it will take care of that more than the engine being replaced will. As far as what you should do, get the engine replaced and keep all paperwork for the repair and maybe ask for some extra time on your warranty.