For weeks the skeptics and pundits wrote off John B. Anderson's presidential campaign as one of those intriguing but hopeless quixotic guests. But suddenly Tuesday night there he was standing in a steamy, packed hotel ballroom warmed by what every candidate prays for, the eternal flame of TV lights. No longer was he just Doonesbury chic. No longer just the white-haired guru of a kid cult not seen in national politics since the students went "clean for Gene" in 1968 and McGovern's minions marched in 1972.

It was stunning showing. John B. Anderson was leading in both Vermont and Massachusetts -- the first big industrial state to cast a vote in this year's ever-changing Republican race. Far into the night, the cheering and the vote-counting would go, and finally Anderson would come within several hundred votes of first in both states.

It was a victory that found Anderson's brown eyes blinking with astonishment behind horn-rimmed glasses; a victory that found him raising his voice to quote Cicero. And Lincoln. And Ralph Waldo Emerson ("There is nothing that astonishes men so much as common sense and plain dealing").

The 58-year-old Anderson told his worshipful cadre of college volunteers that he was charging off to Illinois and his next primary and that he was going to carry his campaign across the country, forging a new coalition "united by a belief in power of ideas."

The college kids stood on tables and waved beer bottles and shouted, "Awww Righht?" at his every utterance. When he shouted that "the road ahead for the nomination will not be easy," one student shouted over the din the slogan that was born at Tufts University in the early, dark days of the campaign, "You've gotta believe!"

Now aides were tugging at Anderson's arms, carrying him off for that ritual reserved for winners, the courting by the networks that Anderson once only dreamed of.

Anderson sat under studio lights, taped and wired for national consumption. Aides and TV types whispered obsequiously. NBC, CBS, ABC. They all wanted him. But wait. Could he sit there for 10 minutes, as they hoped for later returns that would claim a victor? Yes, said Anderson. But he had a request. Almost diffidently, he asked. He had to go to another network across town. Could someone go up to his suite and bring down his coat? Fishing his key out of his pocket, careful not to disturb the wires, he said, "There's a trenchcoat hanging in one of those closets up there."

Anderson was handed the latest returns that showed him leading with 25 percent of the vote. This man who quotes from the classics and can roll out phrases in oratorical cadence, could only say, "Wow." Dawn of Euphoria

The major question, of course, is whether Anderson is going anywhere after Massachusetts, where he benefited from a strong independent, moderate-to-liberal crossover vote. But as Anderson plotted tomorrow's strategy in a hotel room, the victory party downstairs was thinking only of the moment. Loud rock music blared and it looked more and more like fraternity beer bust. New friends were made as MIT met Brandeis met Harvard met Boston U. met Swarthmore met Radcliffe. Around midnight a girl wearing braces kissed a boy and with the eternal cleverness of such moments he replied, "Gee, it was fun meeting you."

Some draped their arms around each other and hung around the TV sets for the pearls of Uncle Walter Cronkite. Then, around 12:30, as the TV crew yanked out the life support system of the evening, two students looking as if they had walked off the set of "Animal House" strode up to the podium where Anderson had moments before ignited them with dreams of glory. One wore a faded black derby, the other a cowboy hat stuck with Anderson buttons, and both wore beards. They leaned silently on the podium and just stared out at the crowd, rehearsing some never-to-be-given speech, ignored by all in the room, lost in their reverie.

Meanwhile, on the streets of Boston, euphoria was absent. The cab driver had heard the news. "That Anderson fella, how about that? I hope he lives up to his reputation."

He paused. "But I don't know what his reputation is."

Another pause. "I never heard of him." Liberal Drummer

All along, the wild card in Massachusets was the massive independent vote (1.2 million registered independents). Anderson, billed as the "thinking man's candidate" successfully wooed those voters looking for an alternative and they came to the polls in record numbers for Anderson. In some ways Anderson's campaign is in danger of taking on that precious glitterati tone reminiscent of McGovern's campaign. McGovern had Warren Beatty, Anderson has Paul Newman endorsing him. Both were adored by the New York liberal chic. Anderson is getting the fancy money from Hollywood. Norman Lear took out huge ads in the Boston Globe urging people to ignore the coventional wisdom that a liberal who marches to a far different beat than the conservative Republican Party cannot hope to win the nomination.

In the tonier towns of Massachusetts, many a dinner party battle ensued in recent days over the relative merits of Yalie George Bush and Anderson, the 10-term congressman from Illinois with the Phi Beta Kappa key and Harvard University Law degree.

Frances Gardner, one of the few people over 25 at Anderson's victory party, described the kind of Back Bay Boston internecine struggle. "We've been in the minority among all our friends until just very recently," she said. Her husband, Robert Gardener, is chairman of the board of the Fiduciary Trust Company and is Anderson's finance chairman. "Bush has shown a certain weakness," said Mrs. Gardner in a patrician voice drawing out her words. "Bush is just a Ronald Reagan in a Brooks Brothers suit."

Then she echoed Anderson's rallying cry. "There has to be an extraordinary groundswell for Anderson so that the Republican Party cahn't ignore it."

No one pushes that theme harder than John B. Anderson. The day before the primary, lying on a bed in a hotel suite, blue-stockinged feet crossed, Anderson exploded in anger that Bush had called his a one-state candidacy. Phone rang, aides and family moved in and out to sit on and around the bed and the maid ran the vacuum as Anderson, oblivious to it all, talked on.

On the basis of 2,000 votes in Iowa, "Mr. Bush had a right to preen himself as the heir apparent. That came crashing down in New Hampshire." While he has often been compared to the gentle loser and intellectual Adlai Stevenson, Anderson has a much tougher personality and does not hesitate to lash out against his opponents. "How could anyone say it was all over? How, how can they, in this most explosive and unusual and different of all political years?"

He speaks of the monumental winds of change, "more so than any I've seen in 20 years in Congress. We're literally talking about issues of war and peace, not only overseas but here at home. The volatility and restlessness I perceive can come to a flash point, a crisis stage. The idea that the Republicans would go with the same old conservative thinking that has made it a minority party for 50 years," astounds and frustrates Anderson. "To argue that the Republican party is going to be blind to the absolute necessity of attracting independents and Democrats," he exclaims, shaking his head. "I have forged something quite distinctive."

The messianic touch is there. Anderson, the outsider, is the one Republican candidate who stands alone on such issues as supporting gun control, extension of the ratification time for ERA, federal funding for abortions, a moderate nuclear position. He rails against the hawk talk and big defense spending of his Republican brethren. The president, facing a troubled world and mounting inflation, is a weakened state, says Anderson. It is a "historical precedent." The opportunity for the Republicans "may never come this way again to attract Democrats."'

Keke; his dark-haired wife, who has been sitting on the bed, listening and interjecting her points, her husband sometimes looking on in slight exasperation as she finishes his thoughts, interjects, "If John does well in Illinois the Party has to turn around." She has the same fervor as her husband. "Remember, the Democrats didn't want Carter either."

But skepticism trails Anderson out of Massachusetts. In Illinois and Wisconsin he can benefit from easy election rules which allow crossover voting, but he stayed out of many of the more conservative GOP states. Frank Sargent, the last Republican governor of Massachusetts and a liberal badly beaten by conservative tides, said, "John doesn't have much of a national strategy. Once the votes are counted here, I don't think he's got a railroad ticket to the next station." Gone for John

In 1968, the slogan became "Clean for Gene" as students, galvinized behind Gene McCarthy's antiwar movement, shaved their beards, trimmed shoulder-length hair and fanned out across the nation to gain support from their elders for their candidate. Today they are "Gone for John." Out-bankrolled and out-organized, Anderson's message in New England was pushed in overwhelming measure by his student volunteer cadre.

They wear a different uniform from the antiwar days of hippie beads, scuffy jeans, hair pulled back with rubber bands. Today's look is neat, preppie -- workboots and Adidas, jeans and cords, crew necks and down jackets. The mood is not radical. They are not on the cutting edge of immediacy; of going to a Vietnam. But they are facing an uncertain world and they know it. They are serious. After a decade of disaffection following Vietnam and Watergate, Anderson's youth corps is joining the ranks of Americans who are voting in record numbers this year.

Over and they have a litany as to why they have chosen Anderson. They speak of honesty and integrity and intelligence. At a pep rally overflowing with confetti and balloons one student, David Loeb of Brandeis, reiterates the sobering view of many of his colleagues. "I like Anderson because he's good on the social issues." But, faced with mounting inflation, Loeb also likes Anderson's fiscal conservatism. "He's not the kind to throw money away."

Two students from Harvard, Mike Burda and Max Steur, who spent countless hours working on the Anderson campaign said, "Bush was really hurt on campus by that 'winnable nuclear war' statement." A woman from MIT said Anderson "really appeals to idealistic people. I like his strong stance on women's issues, his freedom of choice stands on abortion and that he is against the draft."

Frank Glynn, 35, a teacher in Lowell, Mass., and a "democrat who is very upset with Carter," i listening hard to Anderson. He has his memories as a McGovern campaign worker and leader of the anti-war movement when he was a seminary student. "The student today are not as rabid. It's a very different mood today. It had to happen after the disapppointments of the seventies. I was struck by a 14-year-old girl who did a paper on nuclear war and said, 'When it happens,' and I said 'What do you mean when it happens?' They see the American system falling apart and that we are humbled by overseas events. They hear the resurgence of war talk, the throught of nuclear war."

Posters say people today are searching for winners and leaders. John Anderson calls it a "hungering."

He has touched the students with an amazing fervor, even with his politics of sterness and his rails against our "self-indulgence" and presses for 50-cent gasoline tax -- proceeds of which would go to lessening the Social Security tax bite. "He's just the only one making sense," said one student from Boston University who shivered in the cold of New Hampshire and Boston, at subway stops and shopping mals, leafleting. "I used to drive two miles to work and a mile and a half to the soccer field. Now I'll take a bike. That doesn't sound like much, but if everyone does it. . ."

In New Hampshire and Massachusetts the Anderson brigade seemed everywhere waving the large Anderson red and white and black signs. You couldn't avoid them. Motorists driving from Manchester to Concord on four-lane highways looked up to see them on the overpass waving their signs indiscriminately to one and all, voters and nonvoters alike, in the freezing afternoon of the New Hampshire primary.

That night in the old New Hampshire Elks lodge that had become Anderson headquarters, they were rewarded with a sign scrawled on the bulletin board, "Thank You, Bridge People." Their ID cards then were a portion of one of the Doonesbury cartoons on Anderson. A volunteer is handing out leaflets to a man who said, "never heard of him." the volunteer replies, "He's never heard of you either. Just read it, okay?" Tuesday night in the Massachusetts hotel ballroom, some of the New Hampshire brigade still proudly wore those badges. One of them smiled and said, "I guess we'll have to change it now." Third Person Righteous

Anderson can sound blunt, chiding, self-righteous, abrasive as he makes his points at times.He can speak of himself not only in the first person singular, but in the first person plural -- and even in the third person, referring to himself as John Anderson. Born again in an evangelical summer tent when he was 9, Anderson gives a Calvinistic tone to his politics of ideas and issues, his warnings of the need for austerity and belt-tightening. He doesn't seem like he would be a barrel of laughs on a Saturday night.

Anderson knows all this. His aides tell him to lighten things up a bit. He is as aware as any 1980 candidate of the elusive, ephemeral and sometimes damaging images voters can get through blips of TV packaging.

"I'm not an angry man. I give that impression when I'm intensely into an issue, but I just love to debate by nature." His son John Jr., a Boston University student, interjects one of the nicknames heard on Capital Hill: "Saint John the Righteous." His father shoots him an annoyed look as he interrupts his train of thought. Then Keke interjects, patting Anderson on the knee as she walks past, saying that was "better than being associated with Abscam, honey."

"I have real humility about my failings and shortcomings. I don't stop to relax enough. I don't like just sitting around drinking with the boys." Anderson says he may take life too seriously but in a pointed reference to President Carter he asks people to look at the alternatives. "We elected one smiler, he smiled his way past the voters and look what that got us. But I suppose I have to belie the image of an angry man. I don't want to etch a profile so harsh and forbidding." He will convey less sterness, he says with a slight smile, but "not to the point of having to put on crazy bonnets. I know what the country needs right now. We don't need a war hero or a national comedian. We need someone who understands how the president and Congress work.

"And someone who can understand the long-term trends." Roiling Onward

As Anderson takes a call from the pollster, Lou Harris, the wife pads around in her stocking feet. The maid comes in to join the crowd. Keke helps her make up the bed. "When my husband is elected president you can say his wife helped you make the bed."

The maid looks blank. "Who's your husband?"

"John B. Anderson," says Keke forcefully.

"Oh," says the maid again.

"He sitting right over there," says Keke, talking while tucking in the bed sheet.

"Oh,' says the maid again.

Not to worry if her husband is not exactly a household name to the blue collar workers or domestics. Keke feels the time will come. Of Greek extraction, Keke is quick and forthright and has been described as both Anderson's cross and inspiration. She says, "Oh, yes, I called Connally a crook and Crane a fascist," in response to a question, but she shrugs and says, "It's true and I'm not going to change." Some observers feel Keke is more ambitious for her husband than he is but she says, "I did not 'push' him to run, as some say I urged him to explore the possibilities, but he alone made the decision." Keke recently ran her own open letter and urged voters to support her husband. "I just had a deep frustration about where the country is going."

Twenty years ago Anderson entered Congress as a conservative Republican from Rockford, Ill.He began to change during the 1968 civil rights struggles and in fact became a leader, one of the few Republicans, for open housing. He said the change in his thinking came through the osmosis of a man who moved out of a "fairly sheltered" life. "There were only 4 to 5 percent blacks, we had no real scabrous slums. I can be faulted, I guess," for not having much of a consciousness about others, says Anderson. But in his childhood, as the son of a Swedish immigrant who owned a grocery store in the Midwest, "a lot of people didn't come within my sites." Anderson is one of six children. Three siblings died of diphtheria and phenumonia, the kind of childhood diseases easily cured today. Although Anderson was an infant and never knew the three, he says the memory of their loss forged a family closeness. His father, now 95, still can cry when he remembers the 3 children who died.

A religious faith played an important part in Anderson's personal life though he doesn't like to talk about it in detail or "wear his religion on his sleeve." While most evangelicals tend to be politically conservative, Anderson has used his faith, beginning with his 1968 open house vote, to justify more liberal positions. "There came to be in my thinking," he has said, "the realization that as a Christian I had to be willing to give up age-old prejudices. . ." He has been in the forefront of Republican opposition to a constitutional amendment that would ban busing to achieve racial intetration in schools.

As Anderson moved toward the moderate and liberal positions he felt disenfranchised by the Republican Party. He was the first Republican to call for Nixon's resignation. His last election to Congress had been a battle and there are many who say that he could not get reelected to Congress, and is running for the presidency because he has nothing else to do.

"I stoutly resist the charge that I have nothing better to do," he says forcefully. Nor is he enjoying a maverick role of roiling up the party Speaking of his 6 a.m. walks through shopping malls and his 16-hour days, Anderson says, "It's too hard work for that, it's too exhausting. I'm not practicing the politics to confrontation. I'm not trying to carefully cultivate an image.

"I don't believe I know it all nor do I feel that it is written on the wind that I must be president. But I am just incurably seized by the idea that I am so right. That I can win in November." Anderson, who sounds as absolute as anybody can on a compaign trail today, says, "I've got as good a crack as any.We are going all the way."