President Reagan returned in high spirits yesterday from the longest overseas journey of his presidency, declaring that the seven-nation economic summit in Tokyo had produced "a unified course for a number of vital issues."

He told a welcoming crowd on the South Lawn of the White House he was "more than pleased" by commitments to combat terrorism made by the leaders of Britain, France, Japan, West Germany, Italy and Canada.

"We agreed that the time has come to move beyond words and rhetoric," he said, to applause from the crowd. "Terrorists and those who support them -- especially governments -- have been put on notice: it is going to be tougher from now on."

The allied nations, while naming Libya as a source of terrorism, refused to join the U.S. call for economic sanctions against terrorists and did not endorse military action, but did agree to strengthen their extradition laws, limit arms sales to nations that aid or sponsor terrorism, and restrict those nations' diplomatic representation.

"We are committed to winning this war and wiping this scourge from the face of the earth," Reagan said.

The president and Mrs. Reagan, who were flown to the White House by helicopter from Andrews Air Force Base, looked fresh despite the 14 1/2-hour flight from Tokyo that ended their 12-day, 22,500-mile trip. "It certainly is good to be back in the good ol' U.S.A.," Reagan said.

The Reagans were greeted by their daughter Maureen, Vice President Bush, members of the Cabinet, sign-waving employes of the White House and executive branch, and 185 children from Martin Luther King Jr. Elementary School.

Nancy Reagan presented five of the youngsters with a 12-foot mural of Tokyo painted by children at their sister elementary school there.

In his formal remarks, Reagan said the "triumph in Tokyo" proved that democratic nations can cooperate on economic issues. Although the summit sidestepped U.S. efforts to pin down a September start for world trade talks and to open direct discussion of agricultural import subsidies, it did advocate further discussion of the consequences of such subsidies.