Are those the only choices? You have a car so you can venture beyond where 95% of American fans of Rick Steves here have visited (primarily because on the rail line)
Since you are there in July I would stay somewhere near the coast, which will likely be cooler than the interior, which you will have visited during your Pienza stay.
The choices are endless, these are some options starting from the closest to Lajatico. But it also depends on which direction you are headed later.
Castiglioncello. A nice and pretty coastal town near Livorno. Very quiet environment although in July there will be people. Sandy and rocky beaches are both available. The white sands of Rosignano are nearby.
Forte dei Marmi. I spent my youth here. Very vibrant and full of nightlife (restaurants and cafes galore). Probably not too quiet in July. Large sand beaches. Upscale environment (high end shopping in the city center if you are interested)
Campiglia Marittima or Suvereto. Two quaint medieval villages on top of hills near the coast. Nearby on the beach proper there is San Vincenzo (beach town similar to Forte dei Marmi, but not as upscale) and the Gulf of Baratti, which is more secluded with very clear waters. If you are interested in Etruscan civilization, Populonia is also there just above the gulf of Baratti.
A bit more to the south, is the Maremma region with the Argentario Peninsula, arguably the best part of the Tuscan coast. Castiglion Della Pescaia, Talamone (Maremma park) Porto Santo Stefano, Porto Ercole (both on Monte Argentario peninsula) are all good. From Porto Santo Stefano you could also visit the Giglio Island by ferry (50 min ferry ride).
Liguria is more mountainous and their beaches are rocky. There are several spots that are nice. In addition to the Cinque Terre, there is Lerici, Portovenere. Further west my favorite are Moneglia (very quaint and not too busy) and Sestri Levante.
I’m not a fan of Santa Margherita Ligure. It’s a bigger busy town especially in July (I’ve been there only in July and August a few times, when I lived in Italy). Not really car friendly, like most of towns on the Ligurian coast, and I don’t care for their beaches, but nearby there is Portofino and San Fruttuoso that are nice to visit (not much of a beach either p, however). Camogli is another choice in the area.
Do some research on the options above, maybe look at the images you find online and see what you like. As I said choices are endless, but in your shoes I would consider my choice based on where you are going next. If you are headed to Milan, then towns in Liguria or Northern Tuscan coasts (basically the coast from Forte dei Marmi to Camogli) are better choices.
But if you are headed to Rome afterwards, then I would head to the Tuscan coast and stay in one of the above Tuscan towns (from Castiglioncello down to Monte Argentario peninsula)