Earlier quoted context omitted.
No, this is because you chose to live extremely far away! There are plenty of places in Massachusetts that are closer and affordable, with decent schools. Every employee I've had who commuted from NH to Boston wound up pretty miserable because of the commute.
There aren't that many places left out there between NH and Boston that are on the affordable scale. Do you have a couple towns in mind that are fairly affordable still? I have been looking in the suburbs of Boston and when I switched it up to look at Southern NH it was crazy the changes in prices as well as how long the houses have been on the market.
+ Acton: there are a couple dozen 1,500 sqft. split levels that come on the market per year. Good commuter rail access to the red line. Top 20 state school system.
+ Andover/Burlington/Frankling are all top 50 school districts, have a limited selction of affordable, though mostly much older houses. You're still looking at an hour to boston, but if you want to work at Oracle, iRobot, Philips, etc. you'll be right there.
+ Westford: You'll find a decent stock of older 1,000-1,500 sqft. places. Top 20 state school system. Horrible commute into Boston proper, but not bad if you work on the 95/128 belt.
Medford and Malden are gentrifying, the former more quickly than the latter, but you're making a pretty big trade-off in terms of school quality.
If your office is walking distance to South Station, or North Station, there are some farther flung suburbs with commuter rail access that would be workable. E.g. Newburyport has a cool seaside vibe and a commuter train into the heart of the city, though you're looking at an over an hour of travel time.
Southern NH is iffy. Windham is the main town for families, has reasonable prices and houses go very quickly in terms of sales. Salem, Hampstead, Pelham, Derry, Londonderry, not so much. You could theoretically commute from Nashua, but that seems insane to me.
If you can afford something in the $750K range you'll find ok townhouses in hip cities like Somerville and Arlington. That sum will get your foot in the door of a fixer-upper in tonier towns like Winchester and Lexington.
As you might be able to guess, I'm in the market as well, so if you've got any advice on hidden gems of towns, I'm all ears :)