If a bb pistol is considered a handgun in NJ then I really don't think you can buy one in Pa and ship it or bring it into NJ to your residence. You cannot buy a 9mm pistol in PA and just ship it or bring it to NJ. So why would a bb pistol be any different?
You can't buy a 9mm pistol in PA and just ship it to your house in NJ because federal law prohibits purchasing a handgun in another state without transferring through an FFL in your state, period. A BB pistol is different because it's not a firearm, period.
Here's another example of perfectly legal activity. I can purchase 30 round AR magazines in PA legally, as a NJ resident. If I modify them to hold 15 rounds before I enter the state, they are legal. Agreed? If your logic held, it would be illegal for me to purchase the magazines in PA because it's illegal to possess them in NJ.
If you lived in PA, bought the bb pistol there, then moved to NJ and brought it with you I think that would be ok.
How is your example different? The only difference is in your example, the moving exception would kick in and allow you to personally transport it in your car to your home in NJ. In my example, traveling with the BB gun could be illegal (most likely would be, but you could make a case that you're transporting it from the store to your home, so maybe you could argue that), but shipping it would not be.
I'll echo what PK90 said, what laws are broken by purchasing a BB gun in PA and shipping it to yourself in NJ?