BECAUSE PAKISTAN continues its pursuit of nuclear weapons, Congress has now cut off American aid there. The dilemma is one with which Congress has been struggling ever since the Soviet invasion of Afghanistan. American law prohibits aid to any country other than the longstanding nuclear powers that tries to build a nuclear bomb. Because the Pakistanis were hard at work on a bomb in the 1970s, the United States ended its aid to them. But it waived the law after Pakistan became the crucial route to supply the guerrillas fighting in Afghanistan. This week Congress let the waiver expire, and it wasn't an accident.

Congress has always been divided between support for the Afghan rebels and the effort to discourage the spread of nuclear weapons. The campaign against nuclear proliferation has been remarkably successful. There are still only six countries that acknowledge possession of nuclear armaments and perhaps two more -- Israel and South Africa -- that have built them secretly. Pakistan is now very close to it.

Ideally, the solution is an arms control agreement between Pakistan and India. For the Pakistanis, the ultimate justification for building their own bomb is that their far larger neighbor and enemy exploded a nuclear weapon 13 years ago. India's prime minister, Rajiv Gandhi, is going to be in Washington later this month to see President Reagan. That provides an opportunity for some missionary work. There's only a thin chance that a deal is possible, but it's a chance worth exploiting.

If that fails, Congress will once again have to decide whether to continue enforcing its nuclear nonproliferation law. The Central Intelligence Agency is reportedly arguing that Pakistan can't be stopped in any case, and cutting off aid again will only demonstrate that the law is ineffectual. That's bad advice. Of course the United States cannot prevent a country from building a bomb if it is determined to do it at any cost. But the United States will set an altogether unwholesome precedent if it ceases to enforce its own laws in this dangerous field.

There are perhaps 30 countries that do not possess nuclear weapons but have the capability to build them. Some of those 30 have been tempted in the past to try it. They desisted, essentially because they realized that going nuclear would detract from their security rather than strengthening it. Perhaps, unfortunately and unwisely, Pakistan will remain adamant. But there are many other governments for which a law automatically ending American aid remains an important reason not to go after the bomb