Hmmm, immigration was very busy last Wednesday when I went through around 11pm. Lots of walking too.
I wouldn't be too worried though as there are plenty of good back-up options.
If you need to stay for the night, Bandara International Hotel is fine and the shuttle takes only 5-10min.
Morning flights start at 5am, and plenty of options to choose from (Citilink / Lion Air / Garuda / Sriwijaya / Indonesia AirAsia ...). Last minute tickets are affordable / very cheap in Indonesia.
If you happen to need Visa on Arrival, the system is as follows: 1. queue to pay the fee (USD37 normally?), 2. move to the next queue which is immigration for those who have paid for VoA, 3. (after VoA immigration) follow the signs towards regular immigration desks (which you can bypass)