I think that legislation applies to national cemeteries.
They're the only places the federal government has jurisdiction. Several states have adopted similar restrictions that are more broadly applicable. I think they'll hold up to court scrutiny, because the courts have long accepted "time, place and manner" restrictions on the exercise of first-amendment rights.
The Patriot Guard Riders have, I think, exactly the right approach -- they put themselves between the mourners and the Phelpsholes' abuse, which they answer with engine noise or dignified silence. Don't be goaded into beating the ever-loving crap out of them -- they count on civil settlements to fund their sick little crusade.