Robert A. Pascal, the Republican candidate for governor, had just finished his standard speech lavishing praise on Baltimore's Democratic mayor, William Donald Schaefer, when people in the back of the room starting shouting, "He's here, he's here!"

Sure enough, there stood Schaefer, his arrival at today's formal opening of Pascal's city headquarters timed perfectly, either by accident or design. Pascal smiled delightedly. "Don," he said to Schaefer, "would you like to just wave or do you want to say hi?"

"I want to say hi to you," Schaefer said, "because you're a good man and you're my friend."

Then, as Pascal's supporters cheered, Schaefer whirled, marched out the door onto Lexington Street and was gone, pursued by the press that sensed another Schaefer slap at Maryland Gov. Harry Hughes.

Schaefer was asked if his appearance meant he was endorsing Pascal over Hughes, a Democrat. "I am a pilgrim and a visitor here, heaven is my home," was Schaefer's answer.

Pressed, Schaefer added, "Look, Bob Pascal is a friend of mine. I like him and I think he understands the problems of this city and cares about it. We've worked well together over the years that he's been the Anne Arundel County executive."

Schaefer was asked if he thought Hughes understood the problems of his city.

"I am a pilgrim and a visitor here, heaven is my home," repeated the mayor, and with that he was gone. During his cameo appearance, Shaefer's clear nonendorsement of Hughes and his declaration that Pascal understands the city was about all Pascal could expect.

"I can't ask him to endorse somebody from the other party, that would be unfair," Pascal said. "He showed up today because he and I are friends. I hope he didn't feel uncomfortable. One thing though, Don Schaefer knows if I'm elected the city will get a fair shake from me."

Schaefer's warm reception for the Republican was in marked contrast to last month when Hughes appeared in the city as part of his formal announcement for reelection. Then, Schaefer pointedly said, "I'll be away, far away," when asked if he would appear with Hughes.

Schaefer and Hughes have feuded publicly throughout Hughes tenure as governor. Although there is no specific issue over which the men have clashed, Schaefer has contended that Hughes doesn't understand the needs of the city and hasn't pushed enough programs and legislation its way.

If Schaefer makes any formal endorsement in the governor's race, it may go to State Sen. Harry J. McGuirk (D-Baltimore), who is challenging Hughes in the Sept. 14 primary.

After Schaefer left today, State GOP Chairman Allan C. Levey gushed, "Was that great or was that great? It couldn't possibly have worked out better."

Republican leaders are hoping today's carefully orchestrated ribbon-cutting cermony, which attracted a number of local Democrats, in addition to many of the state's prominent Republicans, will turn around the three-month-old Pascal campaign, about which one Republican legislator said, "as far as I can see it's dead in the water."

Aware of the slow start, Pascal has shaken up his campaign hierarchy. He has demoted Fred Roberts, the campaign manager brought in six weeks ago from the Republican National Committee, to the role of consultant. In his place, Pascal has hired Bob DeStefano, a friend for 25 years. DeStefano, a businessman, has never run a political campaign before.

Pascal already has campaigned heavily in Baltimore, believing that with Schaefer's support, even informal support, he can get half of the city vote, a figure Hughes supporters scoff at.

Before Schaefer arrived, Pascal, perspiring profusely in the heat, pledged to campaign in the city "door-to-door, neighborhood-to-neighborhood. You cannot win . . . in this state without doing well in Baltimore city and that's the way it should be."

Schaefer had told the Pascal people that he would try to make an appearance at 1 p.m. So, instead of starting at 12:30 p.m. as planned, Pascal stalled, posing for innumerable pictures, then retreating to a back room for some strategy discussions with his adviser, Daniel Zaccagnini, an aide to Sen. Charles McC. Mathias. Mathias was invited to the event but was tied up with Senate business, so he sent a telegram.

Pascal was introduced by former U.S. attorney George Beall, a man he would like to have on his ticket as the candidate for lieutenant governor. "I hope I'm not asked," said Beall. "I really want Bob to win. But there are all sorts of reasons why I wouldn't want to do it."

The main reason, Beall said, is financial. He has four children and to become lieutenant governor at an annual salary of $62,000 would mean a considerable cut in pay.

Pascal has not formally asked Beall to run with him because Zaccagnini, after talking with Beall, advised Pascal that the answer probably would be no. "I haven't been able to talk him into it," Zaccagnini said.

That leaves Pascal without an obvious choice with 19 days left until the filing date. "We'll take care of it shortly," Pascal said. "A week, maybe less."