Let me get this straight, you don't want to buy a car for 4k that's been beat to crap, but you want to buy a wrx for 4k that has been beat to crap with a blown engine? Then swap motors? Then take who knows how long to part out the car? Of course, who knows what else is wrong with the blown engine wrx. And your going to need another beater car while your swapping engines. Not to mention the other costs you haven't factored in, coolant, oil, oil filter, exhaust gaskets etc. plus, while its out, might as well do a timing belt on it. It would be super easy at that point.
Basically, it's going to cost more than you think and it will be more downtime than you think. The smart thing to do would be sell it and buy a different car... And yes, that means prolly not another wrx. Also, make sure you have full coverage on the new car.