Edit: "Is this accurate"
Hamilton, as an artistic work, is really deep into using present references to illustrate how the past works, and this is no exception. Tl;dr: it's a joke made at the expense of people from New Jersey, nothing more, nothing less.
People from New York City, especially from Manhattan Island, have a long history of looking down their noses at the so-called "bridge and tunnel crowd," that is, people from outside Manhattan. This is because Manhattan has been the cultural, commercial, and transportation hub of the region for the last few hundred years. Witness the distinctions made in this New York Times article from 1904, in which the reporter notes who's riding the subway on its first day:
The crowds varied from hour to hour. At first, the down-town trains were sparsely filled and the up-town trains crowded. The explanation was simple; the good folk of Brooklyn and Jersey had come over early to try the subway and get home to bed. Later on the down-town trains began to bear the preponderance; the up-town New Yorkers were trying the new experiment, and the Brooklynites and Jerseyites had gone home.
And it was amusing to note the difference. The up-bound Brooklynites and Jerseyites and Richmondites had boarded the trains with the stolid air of an African chief suddenly admitted into civilization and unwilling to admit that anything surprised him. The Manhattanites boarded the trains with the sneaking air of men who were ashamed to admit that they were doing something new, and attempting to cover up the disgraceful fact. They tried to cover it up with gibes and jokes.
Or, if you want to look at something more recent, check out the famous New Yorker cover from 1976 that illustrates the stereotypical Manhattan attitude towards New Jersey.
This attitude is because, as Ben Franklin put it, New Jersey is a "keg tapped at both ends"-- Jersey is in the shadow of both Philadelphia and New York. In the modern era, this hasn't changed much, despite New Jersey's emergence as one of the wealthiest states in the Union. New Yorkers tend to treat Jerseyites as an indistinct mass, partially because New Jersey local government is extraordinarily Balkanized due to poor planning decisions in the late 19th century. The six densely-populated counties closest to Manhattan have 4.1 million people between them as of the last census -- nearly half the population of New York City itself-- but they're so splintered that the largest city, Newark, has less than 300,000 residents.
Now, to bring this into the context of Hamilton: dueling was illegal but tolerated in New Jersey at the time, which is why the actual duel happened in Weehawken. I suspect Miranda, like any good New Yorker, couldn't pass up the opportunity to throw shade.
So the line about the legality of dueling in New Jersey isn't accurate, but it isn't not accurate. New Jersey was where NEw Yorkers would go to duel, but not because the law allowed it, but rather for jurisdictional reasons, and the lack of specific dueling penalties that would attach in addition to the underlying crime. Put another way, dueling wasn't legal in NJ, but it wasn't illegal either. Some states had specific anti-dueling laws with specific penalties you would face. NJ didn't. You just would face charges for incitement (a challenge), assault (the duel), or murder (killing your opponent). Assuming of course there was a prosecution at all. You can see how this play out in the results of the Hamilton-Burr duel.
New York had specific laws on the books, and again, NJ didn't. This made it very popular for New Yorkers. In fact, of 19 duels known to have been held specifically at Weehawken (the most popular of several known dueling grounds), 14 of them were New Yorkers. While the murder indictment was quashed, since the actual offense had occurred in New Jersey and thus out of jurisdiction, the challenge and planning occurred in New York, so those offenses still mattered. The two seconds, Pendleton and Van Ness, were convicted for their role and deprived of their ability to serve in public office, as mandated by the law. Burr was charged too, but never stood trial. He didn't return to New York for a number of years, and when he did... no one seemed to care!
As for New Jersey, everyone had fled, so there was no one to bring to trial for the murder. Not that prosecution happened much to native New Jersyites, as prosecution for a duel was quite rare there anyways. The uproar over Hamilton's death did eventually lead a grand jury to indict Burr for murder - again, a rarity for a New Jersey duellist - but it was eventually quashed as well, and again, he was gone from the state so it mattered little.
For a bit more on this, check out the AMA on Hamilton from last year, as I covered the duel in more depth (and cribbed this from there).