RIGHT UP at the head of the list of things to be happy that they didn't happen is one of the schemes that evidently stirred for a while in the mind of the late CIA director, William Casey. He was on his apparently ceaseless quest for ways to sustain the Nicaraguan contras, and, according to the newly released Iran-contra testimony of his man for Latin America, Dewey Clarridge, South Africa flashed on the screen. This is how in April 1985 Mr. Clarridge found himself in Pretoria under instructions, as he recalls, neither to solicit nor, if assistance were offered, to receive contra aid but to hear the South Africans out. The folks in Pretoria seem to have been thinking of providing assistance, for a fee, to a friendly Central American government already helping the contras, but nothing apparently came of the plan. Why? The CIA's mining of Nicaraguan harbors had caused what Mr. Clarridge called a ''furor,'' the secretary of state opposed asking Pretoria to get in, or something.

William Casey was testing an idea that didn't pan out, and for that failure one can be thankful. The idea of the United States' finding or facilitating aid from one more undemocratic government in the name of freedom for Nicaragua is grotesque. Yet the incident is important for reasons that go beyond Mr. Casey's passion for the contras. It illuminates the particular view of South Africa existing in internal reaches of the Reagan administration at least at that time.

In early 1985 the administration's policy of ''constructive engagement'' with South Africa was under heavy pressure. The expected reforms were not coming from Pretoria with a pace and depth sufficient to allay rising public impatience in the United States. The widespread suspicion was that the administration was in effect coddling the white minority government, sending it quiet signals that racial change was not all that important to Washington as long as a common front of anticommunism was maintained.

And now everyone can see that, in this small but sensitive corner of policy, the CIA was in fact playing footsie with Pretoria. One part of the American government was demanding that South Africa change its racial ways, and another part was exploring conducting business as usual and opening up a new covert security partnership. It did not actually happen in Nicaragua, as it did later happen in Angola, where the CIA has since resumed support of a rebel faction -- South Africa's horse -- that it first sponsored in the 1970s. But how could South Africa, reading the mixed signals, not have asked itself whether the American government was really serious about seeing apartheid come to an end