drgrant actually has a great FAQ on this topic (and has answered similar questions numerous times). Here is a great summary of the rules related to dealer transfers of handguns:
"In the most basic terms, there are really FIVE categories of MA handgun compliance at the dealer level:
1. Handgun is currently "MA compliant" on EOPS roster and AG's regs. EG- the stuff you see new in most MA gun stores.... S+W M+P, SW1911s, etc, etc, etc... law is must be on roster plus be (somehow) compliant with the AG's insane regulations.
2. Handgun is currently listed on new EOPS Target Roster (see below for current URL)
3. Pre 98 documented - (eg, owner has paperwork showing it was owned/registered in MA before 10/21/98) = completely exempt from AG and EOPS regs. Doesn't matter what the handgun is, etc, as long as that paperwork is there. Also doesn't matter WHERE the handgun currently is either, as long as the paperwork is there. I once had a friend of mine that moved out of MA but had "MA guns" with paperwork intact. He could still transfer them back in the state to a new MA owner, because they were "registered and in the state on/before 10/21/98".
4. Pre 98 on EOPS roster but AG exempt - handgun is on EOPS roster and exempted from AG's regs, by virtue of having been manufactured before 10/21/98. Example here is a typical Glock made before 10/21/98.
5. handgun is on EOPS roster but buyer is a LEO. This situation exempts the dealer from the AG's regs because the customer is a LEO. In this case it doesn't matter when the gun was made, only that the gun was tested and put on the roster.
Edit: Some readers may be wondering what any guns that don't fit into these categories are... the answer is. they're not "MA compliant" by either the AG''s or EOPS regs, or only by EOPS and not the AG's regs... but it should be noted that "MA compliance" is an issue of dealer transfers and has nothing to do with individual possession or private sale. EG- mere possession of a noncompliant handgun, is NOT a criminal offense. This can't be stated enough, as many in MA improperly use terms like "illegal in MA" or "banned in MA" to describe a handgun which a dealer cannot sell or transfer."
Here is the link to the FAQ:
http://www.northeastshooters.com/vbulletin/threads/37553-MA-Handgun-Compliance-Q-A-Thread-(new)