FOR ME, weeks and weeks of weepy "M*A*S*H"-media reached a quiet crescendo late last week, when, as I prowled the aisles of a Virginia supermarket, I heard the "M*A*S*H" title tune doodling in from the Muzak speakers. I wondered how many happy shoppers knew that the original title of the song was "Suicide Is Painless."

Suicide probably will prove exquisitely painful to much of the viewing nation tonight when between 50 million and 100 million people tune in to watch the "M*A*S*H" cast pack it in, ending the show's 11th season prematurely with a 2 1/2-hour special, one whose ratings will help secure a seasonal Nielsen win for the CBS Television Network despite the fact that ABC hit 'em hard earlier this month with seven big nights of World War II. The Korean war, in which "M*A*S*H" has been set, will end a second time tonight, but this armistice is getting a lot more sentimental attention than it did when played out in mere reality a few decades ago.

That is because the Korean war was only a war, and an undeclared one at that, but "M*A*S*H" over its years became many things to many people, in those intimate and shared ways that rare TV programs can. Indeed, the published anguish over "M*A*S*H's" passing has reached a histrionic stage that is just short of embarrassing. But then, nearly everybody could identify with the besieged and embattled characters on "M*A*S*H" because nearly everybody feels him- or herself to be to some extent at the mercy of an aloof and unjust system, which is what "M*A*S*H" was always all about.

"M*A*S*H" premiered on Sept. 17, 1972, precisely three months after the Watergate break-in; the show lazed around at the bottom of the ratings until, it might be said, the disillusionment of Watergate began to seep into the national consciousness, and the idea that crooks and incompetents indeed could have gained control went from unthinkable unlikelihood to flat truism. "M*A*S*H" worked wonderfully as a metaphor for survival in a universe managed by sharks and loonies. You just keep making wisecracks and hope a bomb doesn't fall on your tent.

Larry Gelbart, the casually brilliant Hollywood writer, coauthor of the current movie smash "Tootsie," was present and instrumental at the creation of "M*A*S*H"; he developed it for television (from the 1970 Robert Altman film), and for its first four years and 97 episodes was producer, writer or director, or two out of three at once. Tonight he will watch the last "M*A*S*H" with other "members of the immediate family," he says, not on TV with the rest of the country but at 20th Century-Fox studios in Los Angeles. Alan Alda, the star of the show, is hosting a screening before air time so the cast and creators can have dinner together afterward.

Gelbart chuckles at the thought that CBS is getting a reported $450,000 for each 30-second commercial on the much-ballyhooed finale. "When we started, it didn't cost $450,000 to make an entire episode," Gelbart says.

He continued to watch "M*A*S*H" after leaving the show (though the "developed for television by" credit remains to the end) and agrees that what his successors did with it was by no means perfect. "I wasn't any easier on them than I was on myself," Gelbart says from Hollywood. "I didn't love everything they did any more than I loved all of my own work. They had their ins and outs. But I knew the hard road they elected to keep on, and that's bound to be tough to do. Their intentions were always more honorable--no, not more 'honorable,' that sounds too pretentious. But I think they reached for different values than most of the people in series television. The people who do schlock do work at it very hard--the ones who make 'Shirley and Chachi' and all that--but it just isn't the same."

Or, to put it another way, and Gelbart does, succinctly and accurately, "In the slum that television is, 'M*A*S*H' looked like St. Paul's Cathedral."

Over the years, "M*A*S*H" did deteriorate. Some of the cast defections never really were overcome--particularly the departure, in 1975, of Wayne Rogers as the irreverent and unapologetic Trapper John. His replacement, Mike Farrell as B.J. Hunnicutt, was too much a mirror-image of Alda's Hawkeye, a character that grew less amusing as Alda himself Got Religion, of the ERA strain, off-camera. The official "M*A*S*H" line is that the characters "grew" and mellowed, the way Edith Bunker evolved on "All in the Family." But it also could be said that as everybody cooled out, the show and its comic frictions became decreasingly electric.

Only nominally was "M*A*S*H" set in the past, however. It really was set in the present. Surely few people were immune to the fact that the Korean war really was the Vietnam war put through TV time-shifting. Eventually, when even the Vietnam war sputtered out, the period setting grew almost entirely irrelevant; this was just a microcosmic collection of harried souls braving fate and foolhardiness as best they could.

"M*A*S*H" has had its consistent detractors over the years. Reportedly, at least one official at the Korean Embassy here will jump for joy once "M*A*S*H" calls it quits (though he'll have to contend with its reruns into perpetuity). A recent letter to the Los Angeles Times charged that blacks were under-represented in the "M*A*S*H" unit, but Gelbart says, "We always made it a point to show blacks in the roles they really played in the war. We did a lot of research on this, so we know. There weren't many black surgeons. Integration hadn't come as far as we might like to think it had." Gelbart finds more credibility in complaints from Asian-Americans about the portrayals of Koreans on the program. "I would tune in and hear one of them speaking and think to myself, 'That's strictly a Beverly Hills idea of what Koreans sound like,' " says Gelbart. "I get uncomfortable about that."

But for most "M*A*S*H" fans, the show probably expires in a state of exalted blamelessness. Newsweek magazine all but suggested Americans toss out their television sets, since there'll be nothing left on the air to watch after tonight (in fact, "M*A*S*H" blazed a trail now followed by NBC's "Hill Street Blues," which is even better written, more complex, and less compromised than "M*A*S*H" itself). "M*A*S*H-ness" is next to godliness as a sensitivity credential. Hence a line of "M*A*S*H" greeting cards published by Novel Greetings Inc. of Silver Spring, one of which shows the gang from the 4077th raising a toast in their tent. On the inside it says, "To the best things in life . . . FRIENDS."

Somewhere along the way "M*A*S*H" became as correct and cuddly as a Muppet. Yet there is no reason whatever to begrudge the show's millions of fans all that it has come to mean to them.

Not only, however, is there life after "M*A*S*H," there is "After M*A*S*H" after "M*A*S*H." That's the working title of the planned sequel to the series that will pick up where "M*A*S*H" left off, in terms of story and, CBS hopes, in terms of ratings, next fall. One might expect Gelbart to look upon such a project as exploitive at least, heretical at worst.

But he doesn't.

"No I don't, because I think I'm going to do it," he says. "I think there's a chance to do something here better than the usual spinoff. It's a chance to take what this show laid down a step further. In no sense do we want to repeat what's been done. 'M*A*S*H' was a show about doctors and the men on the table, who were then patched up and sent on. The new show will give us a chance to see what 'on' is and, in a sense, what happens to all veterans when they return home from a war."

The series will be set in a typical American town "when there still were typical American towns," in the early '50s, Gelbart says. So far, three members of the current cast have been signed to continue in the roles they played on "M*A*S*H": Harry Morgan as Sherman Potter, Jamie Farr as Klinger, and William Christopher as Father Mulcahy. None was in the original cast of "M*A*S*H" when it first signed on the air.

Gelbart will write some of the early episodes--"two or three transitional scripts," he says--and then stay around as a consultant. Since titles are muy importante in Hollywood, Gelbart is asked what he'll be called. " 'Darling,' I hope," he says. "Actually, the real thing to get in Hollywood is not a title but a parking space. I don't care what they call me." Technically, there already is a "M*A*S*H" spinoff on the air, the egregious "Trapper John, M.D." Gelbart says his only connection with that show is "that I don't watch it."

That Gelbart is willing to return to television at all comes as a surprise. He has spent the past several years writing movie comedies from the commercial hit "Oh, God!" to the critical darling "Movie, Movie," and in recent weeks won, with Murray Schisgal, the best screenplay award for "Tootsie" from both the New York Film Critics and the National Society of Film Critics. The screenplay also has been nominated for an Oscar.

The man one would expect to be sick-of-it-all when it comes to television (he had a bad experience with NBC under Fred Silverman with an innovational show called "United States" that the network bought, then buried) says, "Wellll, I get sick-of-it-all every year or two. I'm always excited by a good idea whichever medium it's in."

And, Gelbart suggests, writing movies is a more excruciating form of torture even than writing television shows. "The Academy Award, if I get it, will have cuts and bruises all over it," he says. "Screenwriting is not A Day At Malibu, like some people think. It's a lot of pain. I found out that a screenwriter is just a notch higher than men's room attendant in the view of the people who make the movies."

He refers to one movie experience as "a disaster" and, prodded, identifies this one as "Neighbors," the comedy failure with Dan Aykroyd and the late John Belushi. After that, Gelbart says, referring to both "Neighbors" and "Tootsie," "I said I never wanted to work with an Oscar-winner again who was shorter than the statue." Prodding or no, Gelbart won't say who he means, but it is likely he means John Avildsen, who directed "Neighbors," and Dustin Hoffman, the obstreperous Toots himself.

As it happens, there's been considerable published speculation about how many cooks it took to whip up the "Tootsie" script. Pauline Kael began her review of the film in The New Yorker with a lengthy history of its alleged origins--a regular "Rootsies." Gelbart says, "I terribly resent how tainted the credit has become. There seems to be a need out there to believe that anybody but a writer wrote a movie."

The experience makes the hectic days of thrashing out "M*A*S*Hes" look particularly halcyon--even though, Gelbart recalls, he'd be at the office at 5 a.m., getting frantic phone calls from Danny Arnold over at Paramount making "Barney Miller" and eating multiple boxes of Winchell's Doughnuts.

"With 'M*A*S*H,' I wrote for mimeo," Gelbart says; pages went from his typewriter to the cast and into production. "I didn't need to make carbons to prove what was mine later. In one medium, people have faith and go along with you, and in another the movies , suddenly there's $20 million at stake and a kind of feeding frenzy occurs. They throw your script in the water, and people start chewing on it. It's disgusting."

Gelbart returns to television a richer but sadder but wiser man. In a way, he has lived out his own "M*A*S*H," finding himself at the mercy of looming Powers That Be, trying to hang onto his sanity and his dignity, defending himself with his wits. The gang on "M*A*S*H" is Everyman's Extended Family, and one such extended family is the gang behind the gang at "M*A*S*H." In any such group of actors, writers and producers, there'll invariably be some, many, who feel they've been through humiliating, infuriating, or at least compromising professional experiences, the blame for which they may lay, justifiably or not, with some besotted Bozo in an executive suite.

This time, the good guys won. That's the triumphal part. That's the story of "M*A*S*H" and what it has meant not only to those who've watched it, but to television. We know what Tennyson would have said: "When can their glory fade? O the wild charge they made!" When can their glory fade? How long will "M*A*S*H" reruns continue to draw audiences? "I won't be around to know," says Gelbart, for one. "I suppose people will o.d. on them finally, but young people 16 and 17 years old are just now finding the program. So I guess it could really go on forever."