Nearly three months after their return from captivity, the American diplomatic personnel held hostage in Iran were honored yesterday with medals for valor and a pledge from President Reagan that their ordeal will not be forgotten.

The former hostages were guests of honor at a brief but poignant State Department ceremony featuring a message from Reagan, a brief speech by Secretary of State Alexander M. Haig Jr., and the applause and cheers of their Washington co-workers.

L. Bruce Laingen, the senior American official in Tehran during the long captivity, said the observance was "a ceremonial end of the journey." Laingen added, however, that foreign service personnel and the nation are only at the beginning of learning how to prevent or cope with such situations overseas.

About 30 of the former hostages and their spouses will go to the West Virginia resort, The Greenbriar, for a reunion and medical checkups beginning today. Laingen expressed confidence that the psychiatrists and other doctors will find that "we are really quite normal."

State Department sources said only two of the former hostages are known to be having serious medical problems resulting from their captivity. About a dozen of the diplomats are back at work at the State Department, and all of the career diplomats are expected to have permanent assignments by this summer.

In addition to the 42 Americans who were released as a result of the negotiations through the Algerian government on Jan. 20, 14 were released earlier by their captors. Six others initially fled to the Canadian Embassy, which helped them escape from Iran.

Of these 72 Americans, a total of 54 were foreign service personnel or U.S. Marine Guards assigned to the State Department, eligible for the Award for Valor, the State Department's second-highest award. A total of 36 of the former hostages appeared at the ceremony yesterday, including four who did not receive the award because they were not foreign service personnel.

Awards also were presented at the ceremony to key State Department career officials involved on the Washington end of the long captivity, to members of the State Department's Iran Working Group, to diplomatic wives, the hostage family group and a host of other "special contributors" who assisted in the hostage return.

Haig, in his remarks, drew a sharp distinction between U.S. policy concerning the hostages, which the Reagan administration did not approve, and the superlative execution of the policy by career personnel. Haig said without elaboration that the Reagan administration would have managed the situation "in a somewhat different fashion" had it been in office.

Reagan, in a written message read by the secretary of state, said, "We must be resolved that this cruel episode in our history shall not be forgotten, that we will assure our professional diplomats, and military personnel as well, every means of protection that America can offer."