You are wise to ponder this and ask for input. On the surface, this seems like an obvious “cut your losses” situation, and maybe that’s where it will end up. But it depends on several factors. First of all, what else could you get for $3000-$4800, and would it be as good as this car? That salvage engine is a total unknown, BTW. If you put in a rebuilt engine, you’d get maybe 200,000 more miles out of the car, how does that influence your decision?
At the very least, you should consider other potential big expenses before deciding. The most obvious is transmission - if this is an auto trans and it’s the original one, never rebuilt or replaced, then that’s another major repair that may be approaching in the next year or two or three. How is the front end suspension and steering? The A/C?
On the other hand, if you just rebuilt the transmission, then that might make a decisive difference. If the body and interior and glass are beat up, just move on, but if it’s pristine, then maybe you can make a case for the repair. I advise against selling it to the mechanic doing the work without advertising it elsewhere to see what you can get.
I know nothing about these cars, but if they are common, then one alternate solution is to find a donor vehicle for sale cheap - say for example one with a failed transmission, or has been “totaled” in a way that didn’t effect the engine. If you could pick up that car for, say, $500-$1000, swap engines, the repair might be somewhat less…maybe.
But this is an interesting situation and I’m sure there will be some useful offered by others here.
Hope that helps somewhat.