For a short commute and mtn biking aspirations, I would be looking for a new or used hardtail 29r. Or at 5'8" maybe a 27.5"/650B wheel size.
New will get you a real decent bike that will last a while, but you'll probably be looking at better bikes in very short order.
Used, you can find the better bikes more in line with your budget, but ideally, you'll want a bike 2-3 years out "barely ridden." Stay away from bikes which look like they've been through the wringer.
There are also Dual Sport bikes out there, like the Trek DS series, which tries to split the difference between on- and off-road, but from your input, I'd steer you toward a straight out hardtail mtn bike. Post in the mtn bike subforum for better suggestions on such...