CGK check-in usually opens ~3.5 hours before departure.
No idea on what to do locally -- I brought a good book on my last self-connect (coincidentally also 18.30 arrival // midnight departure!). Many locals arrive 6+ hours before their flight so landside is frequently busy. The airport is far from the city, and traffic is never "good".