President Carter paid a nostalgic visit to the boyhood home of Mark Twain today as his press secretary staunchly defended the president's seven-day trip down the Mississippi River.

"There's absolutely nothing he could be doing this week that would be more important than what he is doing," Jody Powell told reporters aboard the Delta Queen steamboat. "Congress has gone home."

At the same time, Powell attempted to minimize the importance of the controversies facing the administration back in Washington concerning Palestinian rights and the resignation of U.N. Ambassador Andrew Young.

"The foreign policy flaps were just flaps, and not the sort of thing that should have caused the president to fly back to Washington," Powell delcared. "To the extent he needed to be involved, he was involved."

It was the second time in two days that Powell has made such a statement as Carter nears the end of his "working vacation." On Wednesday night, Powell said "It doesn't make a damn bit of difference where the president is -- in the White House or on the banks of the Mississippi."

Citing a Washington Post editorial critical of the trip, Powell said: "The Washington Post editors just came back from vacation on Cape Cod," during which time they let "interns run the newspaper."

He said the controversy over the administration's Middle East policy "doesn't amount to a hill of beans." The only thing Carter's presence in Washington would do, Powell said, would be to add hype to events that have been overhyped to begin with.

According to spokesmen, Carter has kept in touch with Washington by telephone, but he and Powell have repeatedly avoided any discussion of Mideast policy as the president, his wife, Rosalynn, and their daughter, Amy, have floated down the Mississippi.

Instead, Carter has plugged his "windfall profits" tax proposal and plunged into the enthusiastic crowds at each of the 41 stops he has made since last Friday.

Carter was up at 4:48 this morning shaking hands in the predawn darkness when he encountered John Lynn, a United Auto Workers member who said his brother-in-law had been imprisoned by the regime of Iran's Ayatollah Ruhollah Khomeini.

Lynn was angry over Carter's decision to permit the sale of $47 million worth of kerosene and fuel oil to Iran. And he accused the president of "more or less condoning repressions and executions by the ayatollah."

Carter, who maintained that Iranian families needed the fuel for cooking and heating, told him he didn't approve of the ayatollah's government, "but the fact is they ship us about a million and a half barrels every day and one time they asked us to send a million barrels back."

Several hours later, Carter told reporters aboard the riverboat that his comments should not be interpreted as disapproval of the Khomeini government. The president drew a distinction between disapproving of human rights violations by governments and disapproving of the governments themselves.

The visit to Hannibal, a town of 19,000 perched on the clay banks of the Mississippi, was a nostalgic, low-key affair for Carter. He toured the boyhood home of Samuel Clemens, who wrote under the pen name Mark Twain, and then saw the Becky Thatcher house, the Mark Twain Museum and statues of Tom Sawyer and Huck Finn. He also saw a skit taken from Twain's works.

In the only substantive announcement of the day, Carter said he has asked for new legislation to find ways to harness more hydroelectric power along the Mississippi. Of the 27 locks he will pass through on the trip, only five have hydroelectric generators operating to capacity, he said, adding that the river possibly could produce 15 times more hydroelectric power than now being generated.

Carter appeared to enjoy the day thoroughly. At one point he said he was in the middle of reading Twain's "Life on the Mississippi" for the "third or fourth time" on this trip. At another point he said one of the nation's great strengths is "our memories of boyhoods in towns like Hannibal."

The Hannibal that Twain knew was far different from the one Carter saw, of course.

In the mid-19th century, he wrote in "Life on the Mississippi," a visitor would find a "town drowsing in the sunshine on a summer's morning; streets empty or nearly so; one or two clerks sitting in front of the Water Street stores . . . a sow and a litter of pigs loafing along the sidewalk, doing a good business in watermelon rinds and seeds; two or three lonely little freight piles scattered about the levee; a pile of skids on the slope of the stone-paved wharf, and the fragrant town drunkard asleep in a shadow."

Today the town at the edge of the Missouri prairie attracts 250,000 tourists a year who bring about $7 million to spend. Hannibal has 37 taverns and 80 churches. An asphalt-surrounded structure called the Mark Twain Drive-In and Dinette sits next to Twain's boyhood home.

Tourism this summer is down 20 to 25 percent from last year, chiefly because of the gasoline crunch, according to local businessmen. Their big hope today was that Carter's visit would give the tourist trade a boost.

What would Mark Twain think about all of this?

"He was pretty tough on politicians," said Robert Hogg at the Mark Twain Museum. "I bet he'd have a lot of material to write about."

Twain saw politics as a dark world full of villians. "Policemen and politicians . . . are the dust-licking pimps and slaves of scum . . . in America," he wrote.

He also, it should be noted, didn't think very much of those who write about politics. He once wrote that he would not "meddle with politics because we have a political editor who is already excellent and only needs to serve a term or two in the penitentiary to be perfect."