I always felt fine walking through the town of Cozumel, no problems and yes the shops are close enough to the pier, but not sure which pier your ship will be using. If its not walking distance, there is sure to be plenty of cabs there, we never had a problem grabbing a cab in Cozumel. The locals are friendly and don't overly bother you, like some other ports.
Sorry, haven't been to Playa Del Carmen, so can't help you there
Be sure to give yourself plenty of time to just brouse. When we went there we took a horseback ride through the Myan ruins, it was ok, but we really should have just used our time to shop and enjoy the little town. Too many tours and such take lots of precious time from your ports of call.