In Old San Juan is the Butterfly Cafe on Calle Forteleza. Close by is the first cafe to make the Pina Colada. You won't see sunset from either one. Stroll back towards the pier and see if there is a roof top lounge in the Wyndham Old San Juan.
St. Thomas, take the Coral World stop and you will be right at the beach which I believe is Coki. Sounds like a good plan to do beach first then tour aquarium, as the crowds (tours) will be gone. Return to town or Havensight for shopping or the trip up Paradise Point. If you go to Orient Bay, you probably won't want anymore sun in the afternoon. You can have lunch right on the beach then return to town for shopping. Everything Cool if purchased on board the ship includes lunch, so that is when it will be most crowded. You can stop there or other beach/bay side places for a cool drink and not purchase the day pass.