Brookline NH would be a great choice, right on the Mass line, great properties and not very far from the train station in North Leominster Mass that goes straight into Boston. I use it all the time and it's so convenient, no stress on the highway!!
There are a number of areas in NH that will provide easy access to MA and Boston. Is there a commute concern and where to? On the Western side of Route 93 - Route 3 will bring you into the Nashua area (Merrimack further North). Straight up Route 93 you have access to the Salem/Windham/Pelham area (Londonderry further North). Route 495 will give you access to the Atkinson/Plaistow areas (Hampstead further North). Route 95 is on the eastern side and will bring you to the seacoast area, but also has easy access to Route 101. One thing to keep in mind is that the towns that actual border Massachusetts tend to have higher home prices and taxes. Going a little further North of the border may get you a better home for the price while only adding 10-20 minutes to the drive to Boston.
Dover, NH is a fabulous choice. I relocated here from MA. Great purchase values to get in on a reasonable budget and develop quick equity. Easy access to Boston (C&J Bus, Amtrak, close to all major highways). Great community and schools. And...still 15 minutes from the ocean.
Plaistow or Atkinson would be good locations. They are both in NH right on the Mass border with small town appeal but just a few minutes from the interstate highway, about 45 minute to an hour from Boston and about 45 minutes to the NH seashore.