IF SOMEONE told you a criminal law had been on the books since the 18th century and never used, you could be forgiven for thinking it was not needed. The Department of Justice feels that way. So does the Senate Judiciary Committee. But the Senate disagrees. At the urging of Sen. James B. Allen (D-Ala.), it re-passed the Logan Act last Monday - 179 years to the day after it was signed into law by President John Adams.

For all thosoe years, the act has been lying around like a time bomb. It bars private citizens from communicating, without official permission, with a foreign government or official for the purpose of influencing the outcome of any dispute with the United States. From time to time, it has been trotted out for talking purposes when citizen were engaged in political discussions with foreign officials that were not to the government's liking. The last time was during the Vietnam War, when the Logan Act was brandished to discourage Americans who went to Paris or Hanoi from engaging in conversations about ways to end the war. That, of course, is one of the troubles with the statute. It could be used selectively as a political weapon, against not only those who talk politics abroad but also those who engage in commercial negotiations. While we haven't heard the act mentioned much, except by Sen. Allen, in connection with all the recent trips of Americans to Panama for talks about the canal treaties, it could be applied to those exchanges just as it was applied to talks in Paris and Hanoi.

Although the purpose for which this act was drafted was reasonable (to guard against private interference in presidential negotiations), the law was suspect from the very beginning. Most legal experts think its provisions are so vague that they would never stand up in court. And many think those provisions violate the First Amendment. Even the Department of Justice thinks there are enough other laws on the books to protect the President from the kind of interference that would be truly harmful.

But Sen. Allen has had his day. He wedged the Logan Act into the general revision of the criminal code at a time when the Senate was trying to move on to other business. In exchange for its acceptance, he promised not to prolong the debate that had already gone on for seven days. Sen. Edward Kennedy (D-Mass.), floor manager of the bill, bought the deal. That's not what you would call an ideal way to legislate. Sen. Kennedy has suggested, however, that the Logan Act may get lost on its way to a conference committee. It should.