First get a dog. Dogs give you time to activate your HD plan.
You live in massachusetts, the original home of Patriots, but that left when tip and teddy kept getting elected. You really need to first find out what your current laws are regarding weapons possession. Find them and obey them. We sold a house out on the Cape because for me to visit meant I was going to be a felon and It was not worth that to me. My families safety comes first.
Have you handled firearms before? If you have not, first and foremost find someone or somewhere who can teach you safe gun handling. NRA did have some places still in massachusetts but not sure how close to you.
Long guns, including shotguns, are going to be the first option allowed to you I believe. A shotgun with a shorter barrel is a very good choice, loaded with 4 buck or BB lead, they are very effective at the distances you will face in the house. There are several "combo packages" available with remington and mossberg guns, where you buy a 26 or 28 inch barrel for bird hunting and a 18-20 barrel for HD or deer hunting, for your option you do not want the short barrel to be rifled, as this is only useful for slugs, but for your use you want a smoothbore, rifle sighted 18-20 inch barrel. If you can, go out and use the longer barrel for shooting trap, skeet or sporting clays, get used to the gun, so it feels second nature for you to bring it up, flip off the safety and work the action. If you have relatives who have some land, buy a clay pigeon thrower and go out and bust some clays, have fun, but learn the gun.
In defensive use, inside the home, the shotgun rules. It is often the choice of experienced LEO's who have to enter and clear occupied dwellings. There are very few thugs breaking in to your home who will have matching firepower. A 12 ga trumps a 9 or a "footay" every time.
After you get used to your shotgun, you may wish to investigate a handgun, I would suggest that a good .22 handgun will teach your more faster than any other, but is a poor choice for any HD and would lead you to a second purchase of a self defense handgun, but for that you need to again follow all your laws in your state regarding purchase and permits etc.