Grew up in MA and now live in SNH. I think you make some great and sensible suggestions. I agree on Salem as well. No big deal unless you are a witch aficionadoHere are some ideas, I live right by Salem Ma and while lovely, if your not into witch stuff I wouldn’t devote a whole day.
Depending on flight times I might try this.
Arrive on Tuesday and drive to Newport. Eat dinner in town
Wednesday see mansions, tennis hall of fame walk some of the cliff walk. Stay in Newport
Thursday, head to Boston. (~1.5 hours after rush hour). Some of freedom trail, dinner in North End or at legal seafood in the Seaport
Friday, take the high speed ferry to Provincetown at the end of cape cod. (~1.5 hours each way). Used to be town shuttle you could take out to Race point beach, assume still running. Town is interesting, lots of restaurants and art galleries. Head back to Boston on afternoon or evening ferry. As an alternative, if you are big history buffs, skip beach head to Lexington and Concord
Saturday, more Boston
Sunday head north ending up in Ogunquit (depending on weather beach traffic might be issue). It’s about 1.5 drive time, but you could make a day of it hitting a few of these (Salem, Rockport, Gloucester, Newburyport, Portsmouth)
Monday Oqunquit
Tuesday - back to airport
This way you are heading mostly in one direction
Have a wonderful trip
Walking the Marginal way in Ogunquit is nice and get some sea food somewhere. Maybe fit in Kennebunkport around Walkers point as well.
The ferry to P'town is a good idea also.
Also a big fan of Legal Seafood or an Italian dinner in the North End.