There is excellent diving within minutes of the cruise ship dock at Cozumel. Most operations (if you don't go with the cruise ships excursion) will ensure you get back in time if you prearrange things with them. As for the cruise ship excursions themselves, depends on how many divers are on board. Sometimes it's a small enough handful that going with the boats excursion is alright, sometimes there's enough that it's a cattle call.
In Cayman, there is good diving fairly close to where the tenders let you off. Only a short walk to the east is Eden Rock/Devil's Grotto, with easy shore entry, good for snorkeling also. Last time I was there, the dive shop was out of business, but possibly someone else has started it back up by now. Cathy Church's operation is only a few minutes farther up the road. The best diving is on the East End, North Wall and West End off the Turtle Farm. Those locations are bit distance from the harbour so best for a return trip.