In Papeete, I would definitely plan on going to the local market, it’s just ~3 blocks from where the ship docks. In the market you can purchase flowers, vanilla, local crafts, jewelry, clothing, etc. There are also local food vendors. Another option is to take a circle-island tour. There aren’t any beaches in walking distance.
In Raiatea, I would definitely schedule a tour, the locals do sell crafts where the ship docks but there isn’t much else going on in town. I personally would go to Tahaa’ to snorkel at the Coral Gardens or visit a vanilla farm.