Winding up a four-day Middle East swing, U.S. Secretary of State Alexander M. Haig Jr. said today he plans to return to Cairo and Jerusalem in two weeks with "some ideas" for reaching an Egyptian-Israeli agreement on Palestinian autonomy in the occupied West Bank and Gaza Strip.

If that trip ends "constructively," Haig said, a ministerial-level meeting among the United States, Egypt and Israel is a possibility, with the aim of maintaining any momentum that may be given to the now-moribund autonomy talks.

The secretary said in an airport news conference before leaving for Washington that the United States had no formula to inject into the peace process, and he stopped short of committing himself to a long-range personal involvement in the autonomy talks. He said, however, that there is an urgent need to reach an autonomy agreement as soon as possible--without setting any deadlines--and he left the door open for either the appointment of a special U.S. envoy to the negotiations or for his own participation in the months ahead.

"We don't delude ourselves that the fact that we are now adding a greater sense of urgency may make the difference. It may not. But we don't feel we have the luxury of not trying," Haig said.

He said he plans to return to the region after his scheduled Jan. 26-27 meeting in Geneva with Soviet Foreign Minister Andrei Gromyko, after which the Reagan administration will make a new "overall assessment" of the prospects for a breakthrough in the autonomy negotiations.

When asked whether a tripartite, ministerial-level round of negotiations would follow, Haig replied that it is too early to tell, but added, "That is clearly a possibility, providing all goes well and constructively." Israeli officials clearly were heartened by Haig's commitment to involve himself in the peace process at least for the short range, and by the respite in the strain of U.S.-Israeli relations following Israel's annexation of the Golan Heights and the Reagan administration's subsequent suspension of the U.S.-Israeli strategic cooperation agreement.

Israeli Foreign Minister Yitzhak Shamir beamed during the joint news conference as Haig said that relations between the two countries "remain on a very sound footing, as they have historically, and this visit was a further contribution to that sound footing."

But Haig said a resumption of the strategic cooperation agreement was not discussed "in detail" during his talks with Shamir, Prime Minister Menachem Begin and other officials, and he declined to say when that issue would be raised again.

Both Haig and Shamir acknowledged that there are still wide differences between Israel and Egypt on autonomy after 2 1/2 years of negotiating, and both expressed guarded optimism that the gap could be closed.

But Shamir, who repeatedly has said in the past that Israel has reached "the limits" of its concessions, characterized future talks as an exercise in persuading Egypt to make concessions, while Haig said concessions are not what is needed.

"The position of Israel in this negotiation is known and was discussed. I said before that we will make a great effort to achieve an agreement. We will try to convince the other party to accept our position," Shamir said, adding that he was relying on Haig's help in that effort.

Apparently intent on not committing himself to a personal role in the autonomy negotiations until after he surveys the political landscape during another trip to the region, Haig said he was not yet ready to decide whether to appoint a special negotiator, or assume the position himself, or even "retain the status quo," meaning leaving the chairing of the negotiations to U.S. Ambassador to Israel Samuel Lewis and U.S. Ambassador to Egypt Alfred Atherton.

Haig said he regards the pressure arising from Israel's scheduled April 25 withdrawal from the last third of the Sinai Peninsula as "less important than the fact that we attempt to move these talks forward to arrive at a successful outcome at the earliest possible date." Israeli officials have expressed fears that after the Sinai is returned, there will be less incentive for Egypt to show flexibility in the autonomy talks, or even negotiate seriously.

Israeli Interior Minister Yosef Burg, who is head of Israel's autonomy negotiating team, said today that he had told Haig that "April is a traumatic event for Jews and for Israel, and therefore if the Egyptians are not forthcoming in these negotiations, there will be a very, very difficult atmosphere here in the country."

Israeli sources said that in the series of meetings, Haig was asked to provide U.S. guarantees that two small islands in the Strait of Tiran at the mouth of the Gulf of Aqaba, which were turned over to Egypt by Saudi Arabia in 1950, will not be returned to Saudi control after Israel withdraws. Israeli officials reportedly asked Haig to ensure that peace-keeping troops from the U.S.-sponsored Sinai multinational force be stationed on one of the islands.