Maryland Comptroller Louis L. Goldstein smiled through the Maryland Municipal League luncheon and through two Democratic campaign headquarters openings, first in his hometown of Prince Frederick in Calvert County and then in Lexington Park in St. Mary's. Finally, he smiled all the way through the Truman-Kennedy dinner at the American Legion Hall in La Plata.

The only time he did not smile last Friday was when he was asked why a state trooper, who said he was "on duty," was driving Louis L. Goldstein to political events on taxpayers' time. "He's driving on his own time right now," Goldstein insisted during an otherwise unblemished day.

They called him "Mr. Maryland himself" at the lunch in Shady Grove and just plain "Louie" throughout Southern Maryland where he greeted everyone, it seemed, by first name. "It's awesome," observed John Hanson Briscoe, the retiring speaker of the House from St. Mary's County.

Lous L. Goldstein state comptroller for the last 20 of his 65 years, is a legend in his own time. This poses a basic problem for anyone else who wants the office: "How do you beat a legend?

"To me," said Don Devine, a 41-year old University of Maryland professor who is Goldstein's Republican opponent Nov. 7, "the major thing is you've got to let people know he'g got an important office.His whole act is a con to make people think he's got an unimportant job so why not have a nice guy do it? Louis has personalized it into looking like a meaningless job."

The comptroller is required by law to provide "general superintendence" over the state's fiscal affairs, to oversee and enforce "the prompt collection of all taxes and revenues," to regulate the alcohol industry and to countersign state checks. But he is also, along with the governor and state treasurer, a member of the powerful Board of Public Works.

The board, according to Devine, weilds enormous power when the legislature is out of seesion, which is most of the year, creating jobs and spending money almost at will.

That is Devine's view. Goldstein's view, expressed in his characteristic down-home drawl, is that his opponent (whom he never mentions by name) doesn't know what he's talking about.

Goldstein says the board rarely, uses its emergency authority to spend unappropriated funds and limits its job-making role to federally funded programs involving state "matching" funds.

"The main thing is people want taxes and the size of government reduced," Devine said over breakfast last week. Goldstein's reply is that that is the legislature's job and besides, "What services do you cut?" Devine says he wouldn't cut services, just bureaucrats hired with the approval of the public works board between legislative sessions.

This debate, often cast in traditional liberal versus conservative terms, has surfaced in the candidates' joint television appearances. But, complains Devine, nobody much cares.

"It's frustrating in the sense that nobody takes it to be very important," he said.

Devine, who ran Ronald Reagan's 1976 Maryland campaign, has used his nationwide conservative contacts to raise $15,115 through Sept. 26 to get his message across.

"Goldstein, brimming with confidence, has not held a fund-raiser since 1960 and has no plans for buttons bumper stickers. "I haven't had any the last eight years," he said. "I'm not gonna raise any money if I don't need it." As of Sept. 26, his war chest cotained only $5,070.

The candidates' personal portfolio present another sharp contrast. Devine's real estate holdings are limited to his Wheaton home. Goldstein, according to his financial, disclosure statement, owns by himself or with his wife Hazel 2,311.2 acres in Calvert County and 729 acres in Dorchester County. His home, Oakland Hall near Prince Frederick, is a colonial ex-mansion in a wooded setting with pool and guest cottage.

In addition to the comptroller's salary of $44,856, Goldstein receives an expense account that went July 1 from a flat $2,400 ayear to "actual expenses.