How much you still owe on the car is irrelevant. What's important is the value of what's left of the car, engine aside. If the car is immacute, with low miles, it may be worth fixing. You don't generally get any more money for parting out a spotless car than you do for one with normal wear and tear. So if it's not truly exceptional (toasted motor aside) scrap it and start over. You can find very nice V8SHOs with decent mileage for the same $5K or so the engine swap will cost you.
For example, if you have an average-condition car with 100K or so, and an original trans (or average rebuild) the car isn't even worth $5K with the new(er) engine in it, so it would be silly to dump that much money into it. If, however, you have a 50K or less car, spotless inside and out, fresh Doug Lewis transmission, etc., that car would have a lot more value with a fresh motor in it... still probably not worth dumping $5K into, but if you shop around I'm sure you'll find that you can get a motor R&R for about $3K rather than $5K.
*edit* I misunderstood the question in the OP. The same still applies, though. If the car is really nice, you may find a buyer who is interested in doing the swap and having a nice SHO when all is said and done. If it's showing significant wear and tear, you won't find anyone who wants to spend all that cash and still have a car that's got flaws. At any rate, you are going to take a financial hit, so brace yourself.
