Algerian President Chadli Bendjedid said yesterday that he was "very happy" with the Reagan administration's decision to sell arms to his North African nation and pleased with Washington's desire for an expansion of U.S.-Algerian relations.

"We wanted to know whether there was a political will on the part of the American side and we found there is this political will," he said at a news conference at the end of his four-day state visit. "I would say not only on this subject arms sales , but we found this political will also in other spheres."

The Algerian leader, the first in his country's 23 years of independence to make a state visit here, said his discussions with President Reagan and other top officials had been "very frank and very open." Both sides, he said, realized they had "wasted a long time" in establishing closer relations and that "we have missed these opportunities before."

"We realized that before there was really no dialogue between the two countries, and we took the initiative of really initiating a dialogue," he said.

Bendjedid's visit also is the strongest evidence to date of the changing Algerian foreign policy under his leadership since 1979. Previously, Algeria had been a militant, socialist Third World nation closely associated with Moscow and almost entirely dependent on Soviet arms.

Although both Washington and Algiers clearly are pleased by the turn of events, the scope and content of the burgeoning U.S.-Algerian relationship are far from clear.

In addition, closer U.S. relations with Algeria will require a delicate diplomatic balancing act for Washington in its relations with neighboring Morocco, traditionally its main ally in North Africa but deeply at odds with Algeria.

A senior administration official, seeking to reassure Morocco, said Tuesday that Washington did not see its relations with the two rival African states as "a zero-sum game" where improved relations with one side would mean a deterioration with the other.

The Reagan administration is hoping that Algeria will play a more active role in the Middle East peace process, supporting recent moves by Jordan and Egypt to get negotiations going again and helping to neutralize Syria's opposition. Algeria long has been on good terms with Syria and with all parties in the faction-ridden Palestine Liberation Organization.

Bendjedid was vague, however, about his attitude toward either Jordanian-Egyptian efforts or Reagan's September 1982 Middle East initiative, saying that "the question is not how one one should support one project or another" and "one cannot say there is an agreement on a specific project."

"But we do believe that we have established a dialogue with Washington and that this dialogue can help very much in finding a solution," he added.

The United States appears to be just as standoffish on Algeria's top priority: Moroccan occupation of the former Spanish Sahara. The Algerians are the chief backers of the Polisario guerrillas fighting for the territory's independence.

Bendjedid said he had asked Reagan that Washington use its "weight" and good relations with Morocco to help settle the nine-year conflict. A senior administration official, briefing reporters Tuesday, made it clear that Washington had no intention of getting involved as a mediator or launching an initiative to break the impasse.