SOMALIA'S DECISION to pull its troops out of Ethiopia's Ogaden region does not end the quandary in the Horn. Once the Soviet Union had intervened massively on Ethiopia's side and Somalia was unable to muster matching forces, the battle in the Ogaden could only end one way. But will Ethiopia and the Soviet Union honor their pledges to stop at the Somali border once the invaders have been ousted? One wonders. There have been no pledges, moreover, about how Ethiopia will treat the ethnic Somalis who tried to throw off its rule. Nor are there assurances that the Kremlin will stop assisting Ethiopia against secessionists in that country's Eritrean region, though the latter are not backed by an invading force. And whether the Russians will begin a withdrawal of their own forces, and finally withdraw them all - and without taking a base for a payoff - is up in the air.

No one really doubts that the Somalis decided to withdraw only because their forces were being routed. Since they were the invaders, it's right that they should retreat. By doing that so late in the war, however, they forfeited what opportunity they and the United States might have had to gain something of value - protection for kin in the Ogaden or for Somalia proper, agreement to an international presence, reduction of the Russian presence - in return for the withdrawal. So it is that American officials concede that Somalia's own best protection now is "the force of public opinion." That indicates just how weak the Somali bargaining position had become.

Ever since President Carter disentangled himself from his early unwise, if inadvertent, association with the Somali invasion, the United States has urged Somalia to withdraw, counseled restraint to Ethipia, and warned the Kremlin to end its intervention. Given the tragic tardiness of Somalia's withdrawal, however, it must be asked whether the administration should have made itself, as it did, the conspicuous sponsor of a step whose consequences it was poorly placed to control. Probably the answer is yes. Diplomatically and politically, Washington could not allow a Soviet power play to unfold without using the available resources, as inadequate as they were, to limit its effects. The Africans themselves were unable to bring greater leverage to bear.

The United States has shown a dedication to the principle of territorial integrity - Africans outside the Horn should appreciate that. It has shown that it is prepared to try to work out African disputes on African terms. Unlike the Soviet Union, it is not exposed to charges that it is acting in the Horn out of great-power designs of its own. That formidable uncertainties remain only illustrates the dimensions of the Soviet challenge. The hope must be that American diplomacy is earning the United States extra African support in coping with them.