I do not know about safety after dark, but Old San Juan is very good.
It is more Spanish than Caribbean with the 16th century forts and walls. There is the medieval charm of Southern Europe. Arriving at 5:30 does pose a problem. If I were in your situation, I would see if the tours office on your ship offered an accompanied guided walking or driving tour of the old city.