This would be applying a "need based test" - exactly what Bruen struck down.
Here are what I think are the relevant sections. Oddly, looks like a NR can bring a non-AWB long gun to a MA shooting range but not a handgun.
Section 124B. (a) A temporary license to carry firearms or ammunition within the commonwealth shall be issued by the colonel of the state police or their designee in accordance with the qualification requirements and procedures for a license to carry firearms issued under section 124, to:
(i) a resident of the commonwealth for purposes of sports competition;
(ii) a nonresident for purposes of a firearm competition;
(iii) a nonresident who is in the employ of a bank, public utility corporation, or a firm engaged in the business of transferring monies, or business of a similar nature, or a firm licensed as a private detective under chapter 147, and whose application is endorsed by an employer; or
(iv) a nonresident who is a member of the armed services and is stationed within the territorial boundaries of the commonwealth and has the written consent of their commanding officer.
Section 127A. (a) A nonresident who is at least 18 years of age may possess common long guns and ammunition therefor pursuant to subsection (b) if the nonresident has a permit or license issued from their state of residence which has substantially similar requirements to those of the commonwealth for a long gun permit as determined by the colonel of the state police pursuant to subsection (f).
(b) A nonresident who is at least 18 years of age may possess common long guns and ammunition therefor: (i) to hunt during hunting season with a nonresident hunting license or a hunting license or permit lawfully issued from their state of residence which has substantially similar requirements to those in section 11 of chapter 131, as determined by the colonel of the
state police pursuant to subsection (f); (ii) while on a firing or shooting range; (iii) while traveling in or through the commonwealth; provided, that the common long guns shall be unloaded and secured in a locked container pursuant to sections 126B and 126C; or (iv) while at a firearm showing or display organized by a regularly existing gun collectors’ club or association.
(c) A nonresident who is at least 18 years of age may possess a pistol or revolver in or through the commonwealth for the purpose of taking part in a pistol or revolver competition or attending any meeting or exhibition of any organized group of firearm collectors or for the purpose of hunting; provided, that such person has a permit or license to carry firearms issued from their state of residence which has substantially similar requirements to those of the commonwealth for a license to carry as determined by the colonel of the state police pursuant to subsection (f); provided, however, that in the case of a person traveling in or through the commonwealth for the purpose of hunting, they shall also have on their person a hunting or sporting license issued by the commonwealth or by their destination state.
(d) A nonresident may carry a firearm on their person while in a vehicle lawfully traveling through the commonwealth; provided, however, that the firearm shall remain in the vehicle and if the firearm is outside its owner’s direct control it shall be stored in the vehicle in accordance with section 126C.
(e) Police officers and other peace officers of any state, territory or jurisdiction with