It isn't a town discretion thing, it is state law. If it were otherwise, I would never have lived in my house for the past 40+ years. Developer filed plans to build a large development (this was early 1950s), the town held up approving the development and changed the zoning law to require a minimum of 1 acre lots, then denied the applicant. Developer sued the town in Land Court and won. I researched the title to my property when I bought the house in the mid-1970s and learned that history. State law requires a town to honor the zoning regulations as of the date of the filing, and doesn't allow this sort of shenanigans.
If the proposed gun shop sues Newton, they don't stand a chance in court and it will cost the town. Problem with MGLs is that you can not recoup your legal fees when you win, so it will be a significant cost to the gun shop owner too.