Have been to both places several times. In 1998, on the Regal Princess, a warming was issued by the U.S. State Department and slipped under every cabin door saying that "conditions in Colombia indicate that foreign visitors are not always welcome and we urge extreme caution while traveling in Colombia", or words to that effect. This was a smart move by Princess to give people a choice whether to disembark or not. I did not go ashore that time.
I have gone ashore in Cartagena 3 other times and yes, it is a marvelous, gorgeous city. If you can steel yourself against the vendors and just block them out if they do not look like they will cause you physical harm, it is worth a ship-sponsored tour to see the magnificent walled city. I would not venture out on a tour unless it was through the cruiseline.
Costa Rica was wonderful when I first went there in 1994 and has only improved. The people of Costa Rica are some of the warmest, kindest, happiest people I've met anywhere in the world.