Prospects for a government of national unity with Israel's two major political blocs appeared much improved today following new talks between Labor Alignment leader Shimon Peres and his Likud bloc counterpart, Prime Minister Yitzhak Shamir.

Peres and Shamir, who just two days ago had appeared to break off their talks, citing "serious obstacles," met twice today and later said they had made progress toward an agreement.

Peres told reporters after the second session tonight that he was confident he and Shamir would reach a final accord by Friday. Earlier today he said, "We have overcome the outstanding issues which have served as a stumbling block between us and have started to deal with the structure of a future Cabinet."

Shamir appeared more cautious, saying there remained "pending problems" to be dealt with. He added, "I cannot see any differences that cannot be overcome," but later added another note of caution, saying, "I don't think there are any obstacles in our way, but you can never know."

Shamir's caution reflected the popular reaction following a week of developments in which high optimism has alternated with despair as the two sides struggle to wring all the patronage and political benefits they can from bargaining designed to end the country's six-week-old political deadlock.

The two leaders appeared to have finally resolved some of the key issues. Sources said they have agreed to alternate the post of prime minister, with Peres taking the first 25-month term and Shamir the second. Shamir would serve as acting prime minister in Peres' absence and as foreign minister, positions that would be shifted to Peres when Shamir took over as prime minister.

Likud apparently has agreed to Labor's demand to have the Defense Ministry, Israel's most important Cabinet position, for the entire 50-month term of the new government. Former Labor prime minister Yitzhak Rabin is expected to hold that post, but he will have a Likud member of parliament as his deputy.

Peres and Shamir also appear to have reached a compromise on the main outstanding political issue, the fate of controversial Jewish settlements in the occupied West Bank that have been approved by the outgoing Likud-led Cabinet but not yet built.

The two reportedly agreed that the new government would recognize the validity in principle of the prior approvals but that the timing of new settlements and further development of existing ones would be subject to specific decisions by the Cabinet, governed by majority rule. Since the Cabinet is to be equally divided between the two sides, such a formula would appear to give the Labor Alignment a veto over new settlements.

Asked if the settlements issue had been solved, Shamir said tonight, "It's not been solved, but I hope we have found a way to cooperate, how to work together despite the existing differences of opinion."

Not all of the Likud's political allies agreed with Shamir's assessment. Science Minister Yuval Neeman, a leader of the right-wing Tehiya Party, which advocates increased settlements and eventual annexation of the occupied territories, said the accord between Labor and Likud amounted to a "total freeze of the settlements process" and would "endanger the security of Israel."

Peres faces similar problems with his left wing, many of whom consider an agreement with Likud as a sellout of Labor's political principles. Mordechai Virshubski, a member of the Shinui Party, a Labor ally that won three seats in the parliament, told Israeli radio the alternation of the prime minister's job was unworkable and against the basic principles of Israeli law.

"This is not going to be a government but a constitutional catastrophe," he said.