WHEN MARGARET Thatcher spoke at some length about Northern Ireland in her speech to a joint session of Congress, she was, in a way, singing for her supper.

Britain's prime minister was most desirous of speaking to the world from the well of the House -- it put her in the Churchillian mode -- and in the negotiations leading up to what she called "one of the most moving moments of my life," it was borne in on her that Northern Ireland is a subject of passionate concern to House Speaker Thomas P. (Tip) O'Neill and other Irish-American members of Congress.

It has not been with her. Her conditioning would explain her attitude. It was harrowing, beginning with the terrorist murder of her dear friend and counselor for Ulster, Airey Neave. He was blown up in the garage of the House of Common by an IRA bomb. It continued with the IRA assassination of Lord Louis Mountbatten and reached a bloody climax in the terrorist bombing in Brighton last September -- Thatcher herself escaped death, by inches and seconds.

Some of that horror perhaps informed her withering press conference comments after her summit with Irish Prime Minister Garret FitzGerald.

To each possibility proposed by the New Ireland Forum, a political initiative that brought together all parties save Ian Paisley's irreconcilables, she rapped out, "That is not on." The Irish were crushed.

Thatcher had made one of her rare miscalculations. She did not understand the esteem that the benign and cultivated FitzGerald enjoys. He has been called "the most civilized statesman in Europe" and Thatcher's putdown brought her angry reaction from quarters she values.

She was quite taken aback by the fuss, and thus was more than ordinarily amenable to the speaker's proposals about Ireland as an appropriate topic for discussion in her address to a joint session of Congress.

Her remarks on northern Ireland emphasized, understandably, the terrorist aspects of the problem. But she made repeated warm references to FitzGerald -- to hear her, it seemed he was as close an ally as Reagan -- stressing that they would together seek a solution. It's as far as she has gone in underlining the "Irish dimension" of the problem, which is another way of saying that the Republic has a part to play in bringing peace and stability to a wretched warring corner of the globe. She spoke approvingly of the New Ireland Forum report, the document that had incurred her disdain as recently as November.

The friends of Ireland in the Congress might have liked a little more -- perhaps a stronger emphasis on her determination to find a political way out -- but they felt that at least she had at last found the right tone.

Her Irish remarks did not begin to match her fervent declarations on the subjct of Reagan's economic policies or on his new peace initiative which is called "Star Wars." One Democrat grumbled that it was like "listening to another State of the Union with an English accent," and the Republicans had to clap thunderously to cover the Democratic silence at her applause lines.

But the speaker told her at a private meeting that he was "encouraged" by what she said about Ireland. He also somewhat wistfully reminded her that, with her big majority in the House of Commons, she was "the kind of a leader who could make progress."

Thatcher's enthusiasm for Star Wars was another unecessary reminder to weary Democrats of Ronald Reagan's extraordinary gift for inducing people to come down against their own best interests. Europe would not benefit from the trillian-dollar high-tech umbrella that Reagan proposes to raise over the U.S., and Thatcher, after a cordial meeting in London with Soviet Minister Mikhail Gorbachev, had some doubts. But a quick Christmastime visit to Washington and a weekend at Camp David with the Great Persuader brought her around and now his "greatest fan," as she calls herself, is firmly in his corner on research for a scheme that was, this time last year, a big joke.

What she may have gotten in return for her unequivocal advocacy is not known. But there is now no European resistance to speak of. Germany's Kohl does not like to make waves; France's Mitterand is hanging on by his fingernails and Italy's Craxi is ever-obliging. Thatcher's domestic opposition, like Reagan's, is feeble to the point of being inconsequential.

Reagan has always been a staunch friend of the Friends of Ireland, and since a gala St Patrick's Day lunch at the Irish Embassy in 1981, ever more mindful of his Irish patrimony. He and the speaker see eye to eye on Ireland, and the president stuck up for the New Ireland Forum the minute he heard about it.

Now that the speaker has prevailed upon her to say the right thing about Ireland, perhaps the president could persuade her to do the right thing. A man who can sell Star Wars obviously has extraordinary powers.