I’ve replaced engines in three of my cars with used engines and never paid more than 2,000 including labor. And it doesn’t take very long, the longest wait is to have the engine delivered.
After mulling it over, junk the car. It’s thirteen years old and has over 100,000 miles, with a Blue Book value of around $1,000, and that’s probably assuming good physical condition and a running engine.
You might be able to get $35 or so for it if you can push it to a local “Pick-Your-Part” junkyard.
If the heads weren’t cracked, you might find a local small shop willing to just replace the head gaskets for $600 or so for the labor, plus probably $200 for the gaskets and (non-reusable) head bolts), but they’d probably protest and push hard on you to do all those “might as wells” I described earlier. Plus, you won’t know what’s about to pop two weeks later.