To me, that dent looks pretty dangerous. I can see it handling fire roads and non-technical trails, but I don't see it holding up to the rough trails. You can probably call Trek and see how much a new rear triangle would cost for that bike. It will probably be around $300-500 since its non-carbon. You might have luck on places like Ebay or Pinkbike as well but those are rare.
According to the Bicycle Blue Book
$1,681 (Like-New)
$1,601 (Excellent)
$1,441 (Good)
$1,072 (Fair)
If the rest of the bike is clean and the rear triangle in that condition, it would be in that good to fair range. If you can can get that complete bike for $900, then it would be a pretty good deal, but I would still replace that rear triangle. IMO, you can probably find pretty good bike for $1300-1500 that doesn't have issues like this.