He was cast as everybody's good guy, the candidate with great press clippings and no chance of going anywhere. But last night John B. Anderson tore up that script.

Surrounded by ecstatic collegiate supporters in the ballroom of the Sheraton Boston, Anderson quoted that old Bostonian Ralph Waldo Emerson: "There is nothing that astonishes man so much as common sense and plain dealing."

Astonishing and mildly astonished himself, John Anderson of Illinois barely trailed Ronald Reagan in Vermont and George Bush in Massachusetts. b

At one point, an aide showed him some early figures from Massachusetts -- leading Bush by 2 percentage points with a quarter of the votes counted. Anderson, usually so articulate and forceful at the campaign rostrum, replied: "Wow."

On the platform, Anderson addressed hundreds of cheering fans, most of them college volunteers from the Boston area, who adopted the Illinois congressman as their own and had a lot to do with his dramatic showing.

"We tried to make this first and foremost a campaign of ideas," he told them. "We're going to leave here and carry the same message and the same campaign across the country."

While Anderson faces formidable problems in the weeks ahead -- including a shortage of cash and uneven preparations for the heavy schedule of upcoming primaries -- this campaign manager, Michael McLeed, said tonight that Anderson is now considering going south for next week's Florida primary a contest Anderson had planned to skip.

"Obviously, we're going to make just a tremendous strong showing," the candidate said tonight, thanking his collegians. "My heart is overflowing with gratitude."

Anderson poked fun at the wise persons of the press who gave him no chance and at Republican opponents who had dismissed him as a spoiler.

His campaign was calculated to focus on ideas, he noted, "whether or not it was calculated to please the pundits."

"I do not believe I have been a spoiler, as some suggest," Anderson said. "Is it to spoil to offer honest new ideas? Is it to spoil to get away from stale rhetoric? Does it spoil the tradition of American democracy to try to reinvolve young people?"

The young people surrounding him in his hour of glory went fairly bananas over Anderson's rhetoric. Besides Emerson, he quoted Lincoln ("Let us have faith that right makes might"), and Cicero ("With faith comes courage"). h

The college students screamed. One of them shouted: "You gotta believe!"

As he left the ballroom, Anderson was asked if he was surprised.

"Oh, yes," said the 10-term congressman from Rockford, Ill. "I was convinced I would start to win, but I wasn't prepared for first place that quickly -- in Vermont."

Campaigning before the Massachusetts and Vermonts votes were cast, Anderson exuded the self-confidence that has kept him grinning while the so-called knowledgeable observers wrote his candidacy off as hopeless even naive.

"I see this as a two-or three-stage rocket," he explained. "We haven't ignited the second or third stage."

"All week I have felt a kind of tide flowing to the Anderson campaign and it is going to spread across the country," Anderson said at a rally Monday night on the eve of the primary.

Anderson, out-organized and out-bankrolled, pushed forward and gained his surprising showing in large part with a cadre of volunteers -- hundreds of college foot soldiers not seen in such numbers and enthusiasm since Eugene McCarthy's "Clean for Gene" brigade in 1968 and the 1972 "McGovern minions."

Hundreds of those volunteers drank beer and gin and tonic and shrieked every time Walter Cronkite gave a new statistic on the race. It looked like a fraternity party. A huge sheet tacked to one wall bore the Anderson motto born at Tufts University -- "You've Got to Believe."

The students were from all the surrounding schools -- Harvard, MIT, Tufts, Boston University, Brown. Anderson captured the students for two reasons said Sandy Spaulding, a student at Boston Universtiy law school and the son of Si Spaulding, Anderson's Massachusetts campaign manager: "People don't like Republicans because they don't have a heart," Spaulding said. "They're not into social issues; Anderson is. But at the same time, students are more concerned about 18 percent inflation and are no longer sold on the Democrats credit card philosophy. They like his fiscal conservatism."

Despite all of his other handicaps, Anderson believes this is his selling point for the Republican Party -- the ability to recruit new faces.

"I have forged something quite distinctive," he said recently. "I have just got to keep hammering that home to the Republican Party -- to reach out and bring people in.Bush can't do it. Reagan can't do it -- I can."