The Shops at Ocean’s Gate, a retail plaza in Marshfield, has sold for just under $10 million to a dentist in Weymouth.