When lines formed at service stations during the gasoline crisis in 1979, Maryland Gov. Harry R. Hughes turned to Frederick L. Dewberry.

When lines formed at savings and loan associations last week, Hughes turned to Dewberry again.

"I guess I'm the guy who tries to make the lines fade away," Dewberry joked as he went to work Monday as acting director of the state of Maryland Deposit Insurance Fund Corp. (MDIF), the agency created over the weekend as part of an attempt to rebuild the troubled state savings and loan industry.

"My first job is to calm the public," Dewberry said of his latest assignment as a high-level trouble-shooter for the Hughes administration. "Just as it was during the energy crisis, there is a psychological effect at work."

He recalled that during the energy crisis, until the governor limited purchases to alternate days, motorists lined up to get gasoline they didn't need for fear the supply would run out.

And until Hughes imposed a $1,000 per account ceiling a week ago on withdrawals in a 30-day period, depositors lined up to take out money they didn't need at the moment, as word spread of risky investments and possible mismanagement that resulted in two large S&Ls, Old Court and Merritt, being placed under conservatorships.

The graying, heavyset Dewberry, who marked his 64th birthday earlier this month, is no stranger to the shadow of scandal. His own reputation remained untainted as he worked with three chief executives who ultimately were toppled by corruption.

He began his government career in 1962 as a Democratic member of the Baltimore County Commission under Republican County Executive Spiro T. Agnew, who later resigned as vice president of the United States following disclosures that he accepted kickbacks from contractors while in the local government job.

Next, Dewberry sought the Democratic nomination for county executive in 1966. He was defeated by a fellow commissioner, Dale Anderson, who went to prison for political corruption after serving two terms. Dewberry, who by then was Anderson's administrative officer, was appointed executive, and served seven months before losing in a primary to Theodore Venetoulis.

Then, from 1975 to 1977, Dewberry served as executive assistant to Gov. Marvin Mandel, who was convicted on federal political corruption charges.

Dewberry was the logical choice to run MDIF, not only because of his performance during the energy crisis half a dozen years ago, but because MDIF falls under the supervision of the state Department of Licensing and Regulation, which Dewberry has headed since last summer. His added duties bring no increase in his $63,900 annual salary.

Dewberry went to work Monday, his sleeves rolled up, converting the former Maryland Savings-Share Insurance Corp. (MSSIC), a privately funded insurance agency that covered 102 Maryland S&Ls, into the state-backed insurance fund that many thrift depositors mistakenly thought MSSIC was.

The agency was created and given a $1 million budget by legislation approved Friday by the General Assembly and signed into law by Hughes early Saturday. Its primary goal is to facilitate the placement of as many as possible of the 102 privately insured S&Ls under the protection of the Federal Savings and Loan Insurance Corp. (FSLIC).

Over the weekend, the new agency took over the old MSSIC -- lock, stock and barrel. When MSSIC's dozen employes came to work in their sixth-floor offices in a downtown bank building Monday, they found a framed seal of the state of Maryland on the lobby wall, stationery at their desks bearing the letterhead of the new agency (it was printed Sunday at the Department of Licensing and Regulation's print shop) and notification that they were now contract employes of the state.

The new stationery was put into use Sunday, when Dewberry drafted a letter to MSSIC members officially notifying them of the changes resulting from the new legislation.

Although some details must be worked out, Dewberry said that, for the time being, all former members of MSSIC are now members of MDIF.

"It is important that we all act responsively and quickly . . . to relieve as soon as possible the hardship and inconveniences suffered by depositors, financial institutions and others," Dewberry wrote.

Working "at my elbow," Dewberry said, is Francis X. Pugh, the assistant attorney general who is general counsel to the Department of Licensing and Regulation. Charles C. Hogg II, who was executive vice president of MSSIC, will stay on as an aide to Dewberry.

"I'm using all the talent," said Dewberry, adding that he also has retained private legal help from the Baltimore law firm of Venable, Baetjer & Howard.

Gordon N. Wilcox, the highest-ranking career employe of the Department of Licensing and Regulation, said that relying on MSSIC's employes is part of Dewberry's style of management. "We don't pretend to be experts" in all of the 35 agencies that now make up the department, he said.

The fledgling insurance fund already is behaving like a government agency -- it acquired additional space today, taking over vacant offices leased to the banking commissioner in the Blaustein Building downtown.

Dewberry, after a stint as executive director of the Baltimore Regional Planning Council, joined the Hughes administration at its inception as deputy secretary of the Department of Transportation, where he remained until becoming a cabinet member last June.

Friends say his hobbies are built around his family, which includes his wife, Betty, five grown children and seven grandchildren. After watching the legislative proceedings in Annapolis until early Saturday morning and later convening a meeting at his Baltimore office, he went home to the West Hills section of Baltimore County and relaxed by cutting the grass.

Del. Timothy F. Maloney (D-Prince George's) praised the appointment of Dewberry, saying his political savvy will allow him to "find first-class people to run the fund and then run interference for them" by cutting through the inevitable red tape.

"He's a bureaucrat's bureaucrat -- smart and politically sensitive," Maloney said. "He's a survivor."