I my area, junkyards will pay at least $400 for any car, even if it's not running, and will even come pick it up. They pay more if you can drive it in.
But I'm a fan of fixing it, partly because I like doing things like that. The specifics matter. What exactly did the mechanic say is wrong with the engine?
About six months ago, my brother was in a similar situation. 2001 Honda Civic with 190k miles. Mechanic said the engine was shot--the piston rings were gummed up, leading to all sorts of blow-by and oil going out the exhaust. I bought it from him for junkyard prices, and spent the next few months rebuilding the engine with my teenage son. The parts to fix it were surprisingly inexpensive--I think maybe $200 all in for all the gaskets and seals, piston rings, a bunch of new nuts and bolts to replace rusty ones. I spent a few hundred bucks to have a machine shop rebuild the cylinder head. Yeah, it was a bunch of work, but we now have an effectively-nearly-new engine.