The Coast Guard is alive and well.

That may not strike you as news, but at Coast Guard headquarters the view is that the nation's only military service outside the Defense Department has won a two-front war against the budget cutters and those who want to change Coast Guard responsibilities and organization.

It was only supposed to be a one-front war, started in 1980 when the House Appropriations Committee ordered an interagency study of what the Coast Guard does and whether that's the best way to do it. Since World War II, the Coast Guard's traditional life-saving task has grown to include chores such as arresting marijuana importers and watching out for oil spills.

Just as the study was getting off the ground, budget director David A. Stockman opened the second front. Budget reconciliation and continuing resolution bills for fiscal 1982 aimed a harsh blow at the Transportation Department and that's where the Coast Guard is located, sometimes to its advantage, this year to its disadvantage.

But Adm. John B. Hays, who will retire next month after four years as commandant, handled that one neatly. To meet the budget problem, he said, he would close 15 search and rescue stations, cut operations at 16 others and decommission 11 Coast Guard cutters. One of those stations was in Los Angeles, where a large boating population knows how to write letters.

So do former Republican Cabinet members Elliot L. Richardson and William T. Coleman Jr., who sent off a letter to President Reagan, urging that the "readiness of the Coast Guard . . . not be impaired." Coleman was the last transportation secretary to have a Coast Guard officer in his outer office and that officer was one of the most trusted members of Coleman's inner circle.

Time passed. Congress held hearings. A $15.5 million supplemental appropriation was proposed to save all the stations and was endorsed by Transportation Secretary Drew Lewis. It is now working its way through the Office of Management and Budget, where approval is regarded as certain.

When complimented on his skillful execution of the Washington Monument Game, Hays smiled and said, "I was not playing a political game. I see this as the way our whole system works . . . . Had it not worked that way I would argue forcefully that there was not sufficient concern on the part of our citizenry . . . for those things we closed down to warrant their retention in the current budget climate."

So much for the second front.

The other battle had more important long-range implications. The interagency group that studied the Coast Guard included doubters not only from the transportation secretary's office but also from OMB, with which the Coast Guard has had strained relations.

The central concern, according to a number of sources, was a question pushed hard by both DOT and OMB officials: should the Coast Guard be a largely civilian agency or a military one? The Coast Guard has 38,000 military personnel and only 5,500 civilians, or 13 percent, the lowest of any military service.

Hays believed strongly that the essentially military character should not change, but he also opposed the oft-repeated suggestion that the Coast Guard should be in the Defense Department, as at least two bills now before Congress propose.

He argued not from the point of view of budget (over the past decade, the Coast Guard budget has increased more, on a percentage basis, in DOT than the budgets of the other armed forces have done in DOD), but from the point of view of national policy.

"No matter how we were titled or organized in the DOD," Hays said, "even with a separate Department of the Coast Guard, the umbrella of being within the DOD would change and affect the flexibility with which the president and the nation can use the Coast Guard in a variety of ways, such as Cuban operations, such as the Haitian interdiction mission, such as the enforcement of fisheries laws, such as drug interdiction operations, and the use of force generally on the high seas, which we are doing on a regular basis, when necessary."

It is not clear just how far the various arguments for change went, but the Coast Guard managed to attract substantial support for the status quo.

The clincher came on Feb. 16, when William P. Clark, White House national security adviser, wrote Drew Lewis that "a call for major changes to the Coast Guard's military/civilian personnel mix, or to the provision for statutory transfer to the Navy in time of war may well dilute our administration's long-overdue improvement in defense capabilities."

The war was over.

Thus when the Transportation Department recently released its inch-think report entitled, Coast Guard Roles and Missions, apparently the only major change suggested was cutting back oil spill enforcement.

Hays said oil spill patrols will be reduced, but he said they were of questionable cost-effectiveness. In the future, he said, a more effective and efficient pollution patrol will come from the air. New Coast Guard planes will be equipped with exotic sensors and can check for spills at the same time they're looking for mariners in distress or boats filled with marijuana.

There are almost 100 recommendations on how things can be done better (the Coast Guard auxiliary could do more search and rescue; private enterprise might best be employed to run icebreakers), but Hays agreed that little substantive change in mission is proposed.

Raymond A. Karam, DOT's deputy assistant secretary for budget and programs and one of the key players in the study, said it won't just go on the shelf. A plan is being drawn to put some of the recommendations into action.

The study, Karam said, was accompanied by a lot of "kibitzing and sniping when it trod on sacred ground. . . . But if you don't get into those kinds of areas, you're remiss in your work."