It wasn't exactly a victory celebration, but when Senate Majority Leader Robert Dole threw a lively party last night for Donald J. Devine, the fallen chieftain of the Office of Personnel Management, he had a clear political message in mind.

"We like to take care of the wounded in our party," said a smiling Dole. "We're in the foxhole together."

There were at least 16 Republican senators on hand and one of them, Strom Thurmond (S.C.), held Devine's hand aloft and roared to the applauding crowd, "A man of courage and a man of character! We got to stand by him!"

"He saved the taxpayers $18 billion and his reward is the Democrats won't let him be reconfirmed," said Sen. Steven D. Symms (Idaho).

"He handled some of the most earth-wrenching problems with aplomb, ability and good common sense, but this town ate him alive," said Sen. Orrin G. Hatch (Utah).

Devine, flanked by his wife, Ann, three sons and one daughter, seemed a bit sheepish at the beginning of the evening, but soon lightened up considerably under the barrage of praise and reassurance.

"You've got the whole right-of-center in the whole U.S. here," he said at one point, lighting a cigarette and gazing with some amazement at the crowd jamming Dole's ornate offices in the Capitol building.

"Whatever happens, we will be fine," said Ann Devine. "The family is important and we have a good solid family."

Devine, for four years the controversial head of the nation's civil service, withdrew as a nomineee for a second term June 6 after OPM acting director Loretta Cornelius testified before a Senate committee that Devine had asked her to lie about his effort to extend his authority after his term expired. Devine strongly denied in testimony that he had illegally tried to extend his authority or asked Cornelius to lie.

Last night there was no talk of such things, but many slapped Devine on the back and everyone wanted to know what he is going to do now.

He said he wasn't sure. Many advised him to go into private business and make big bucks for a while. Republican leaders in Maryland have said Devine might run for the Senate in '88.

"Don't go too far, we need you!" said Sen. Paul Laxalt (Nev.).

For the time being, Devine has landed at the Heritage Foundation, an influential conservative think tank, as a consultant.

"Jim Watt was with us for a few months," said Heritage Chairman Edwin J. Feulner Jr. last night. "Dick Allen is still with us." Former interior secretary Watt and former national security adviser Allen both resigned after coming under heavy criticism.

All the senators wanted to be photographed with Devine.

"You're gonna land on your feet," Sen. Paul S. Trible Jr. (Va.) told Devine as they posed.

"You win some, you lose some," Devine replied. "You never know."

Sen. Jesse Helms (N.C.) approached Devine and, with hands folded, executed a formal little Asian bow. "I'm so sorry that nobody showed up," he quipped.

"I think it's a disgrace that Don Devine wasn't continued in this job," said Phyllis Schlafly, president of the Eagle Forum, which she described as a national pro-family organization. "He's the one who saved all this money."

Sen. Pete V. Domenici (N.M.) confided to Devine that "if we get our way, we got a whole bunch of your stuff in this budget." "This is wonderful!" said White House Counsel Fred Fielding as he greeted Devine, and Sen. Paula Hawkins (Fla.) told how her husband says government would be more efficient if it were run like business.

Symms, who was wearing a Heritage Foundation tie, spent a good deal of time talking animatedly with Devine and his family, cheering them up.

At one point Symms turned to Devine's daughter, Patricia, and said, "How come they never send a pretty young lady up to see me?"

"They're afraid she won't come back," said one of Devine's sons drily.

Sen. Barry Goldwater (Ariz.), the grand old man of the conservative movement, spent quite a bit of time chatting with Devine. After leaving, he walked with his cane down a Senate corridor and said:

"I've known Don a long time. He's a very good man, and he got a raw deal. That's not unusual around here."