AS PRESIDENT of Egypt, Anwar Sadat has played his high-stake diplomatic role with a magnificent sense of occasion. He has been the unparalleled master of the dramatic moment in our day: from the time he expelled Egypt's small army of Russian advisers, to his extraordinary speech to the Israeli Knesset that launched the Camp David peace process, to his brave gesture in welcoming personally the dying shah. In all this and more, Mr. Sadat has managed to revive in our clumsier era a style of world leadership distinctive for its continuing touches of gallantry. Last weekend, prior to leaving the United States, Mr. Sadat was at his most gallant.

A more cautious statesman would have concluded his formal talks with a new American president by attending the obligatory diplomatic receptions and heading home. Not Mr. Sadat. Instead, he led his official caravan southward from Washington to the Georgia village where his "friend Jimmy," the former president and architect of the Camp David accords, awaited him with public ceremonies and a private dinner. Quoting a German proverb, Mr. Sadat paid tribute to Mr. Carter not only as a peacemaker but as a person: "Friendship is the most delicious fruit in this world."

In their future talks, Mr. Sadat may succeed in constructing a comparable friendship with Ronald Reagan--another gregarious spirit--though neither that prospect nor the chances for an intimate Reagan- Begin friendship alone will determine the future of the region. Nor will Mr.Carter's predictable statement calling for successful conclusion of the Palestinian autonomy talks within the Camp David framework have any perceptible impact on the Reagan administration's approach. Despite that, Mr. Sadat may have reckoned that--at the very least--by renewing his ties with the former president, he would focus attention on the continuity of U.S. policy. That calculation alone, however, did not produce the intriguing detour to Plains, and conceiving of the trip merely as a bid for national advantage insults Mr. Sadat's singular understanding of modern history.

Not since the early and unhappiest years of World War II, when Winston Churchill nudged Franklin Roosevelt successfully toward an Anglo-American alliance against Nazi Germany, has a foreign leader staked his future so boldly on the ability of the United States to reshape advantageously the military and political realities of his region. Although Anwar Sadat hardly leads his own country as a Jeffersonian democrat, he recognizes (as did Churchill in that earlier crisis) the importance of trying to influence American foreign policy not only by identifying his aims with those of his "friend" in the White House (of whatever party), but also by keeping public support constant against all political mood swings. Constancy begets constancy. The only way to have a friend, Emerson wrote more than a century ago, is to be one.