Welcome to FT!
Would definitely recommend a hotel - it will be an uncomfortable night in the airport otherwise, and even if you have lounge the new facilities don't have any quiet rooms / daybeds to sleep on. Depends though on how spoilt / old you are
Best hotels options within a short distance are on Yas Island (7 hotels), or Al Raha Beach Hotel. I usually go to Yas but we were put up in Al Raha Beach by EY a couple of weeks ago as a result of a DNB and it was surprisingly good.
Given the short stay I'd say going all the way into Abu Dhabi city may not be worth it. It's a 40 minute drive, whereas Yas Island is only 10 minutes away.
You won't find any dive bars in AUH - all bars are basically in 4 or 5* hotels. Sufficient options for the night at Yas - Stills at the Crowne Plaza and Y Bar at the Rotana are my favourites - you can also try the Belgian Beer Cafe at the Radisson although it's pretty new and they weren't really up to scratch yet last I visited a month or so ago.
On Yas there's now the Yas Mall, which may be worth a visit. Better dining options there than at the Hotels - Asha's for decent indian (miles better than at Rotana or Viceroy), there's also a pretty good Thai.
If you are on a single ticket they should check you in for both flights at your origin point. Once you have a boarding pass you'll be allowed back into the airport whenever you want. If you haven't been through-checked, simply visit the transfer desk upon arrival and before clearing immigration - they will issue you with a boarding pass which can get you back in.
Note that if you do not have a boarding pass when you leave, you *may* need to wait for checkin to open for your flight, i.e. 4 hours or so before.
The Mosque would be my recommended sightseeing stop - it's about half way from the airport to Abu Dhabi proper, so relatively close. Check timings though, make sure it is open as you have a late arrival.