In resigning as head of the Occupational Safety and Health Administration, Robert A. Rowland has done the Reagan administration the ultimate favor. He has also created an opportunity -- and a test of sorts -- for the new labor secretary, William E. Brock, who will choose his successor.

Mr. Rowland, a former fund-raiser for President Reagan in Texas, resigned amid charges of two kinds: 1) that he was indifferent to the agency's mission and had systematically turned all enforcement switches to Off, and 2) that he was a beneficiary of some of his own official actions because he owned stock in certain affected companies. On the second issue, the Office of Government Ethics said in a letter issued as Mr. Rowland stepped down that he had acted properly, because he had notified former labor secretary Raymond E. Donovan of his holdings; Mr. Donovan had given him a waiver to proceed. The other and more important issue of enforcement is the one that carries over for Mr. Brock.

Mr. Brock, who was special trade representative before going to Labor, has moved skillfully into his new office. Mr. Donovan's relations with organized labor were bitter. Mr. Brock has made himself an instant emissary for his president and party in that direction. He has deftly courted the leaders of the AFL- CIO and has appointed Stephen Schlossberg, the well-regarded former general counsel of the United Auto Workers, as deputy undersecretary for labor- management relations. He has also been careful to present the administration's proposal for a subminimum wage for teen-agers, which labor opposes, as merely an experiment. But the OSHA appointment will be the first substantive public test of his plans.

The agency was created by Congress in the 1970s with good intentions but little forethought. Conservatives have alternately fought and made fun of it, and even in the well-disposed Carter administration it moved at only glacial speed. On the most crucial issue, the health effects of chemicals, the data are spotty and the standards of scientific and legal proof uncertain. The agency has had trouble deciding which of hundreds of thousands of chemicals to go after, and how. Mr. Rowland also created a simpler and more immediate controversy this year when he refused to order field toilets for farm workers.

When the Environmental Protection Agency was similarly troubled earlier in the Reagan years, the administration turned to a respected moderate, William D. Ruckelshaus, to bail it out. In a way, that is also what the president did at the Labor Department when he turned to Mr. Brock. Now it is up to Mr. Brock to do the same for OSHA, and take this chance to put the agency on an even keel. It needs to be done.