IF YOU GET discouraged from time to time about government's inability to deal with the hard problems, reflect upon the surprising agility with which the Social Security rescue legislation is moving through Congress. Not only has the progress been swift, but, marvelous to tell, each step along the way has actually brought additional improvements to the package.

The measure approved by the House last week made better the version proposed by the National Commission on Social Security Reform: it solved, in addition to the short-term Social Security deficit, the long-term shortfall. The House would achieve this by a further increase in the payroll tax in the next century and by gradually postponing the age at which full retirement benefits can be received from 65 to 67.

The Senate Finance Committee bill, which will come to the Senate floor this week, provides additional protection for the fund in the event of severe recessions and a better long-term plan for shoring p the program. The retirement age would be postponed by only one year and the needed savings would come from a slight reduction in benefits for all new retirees. This is a much fairer approach than that taken by the House, which would put a heavy burden on those people who are forced into early retirement by disability or job loss.

The Senate version also allows people who go on working after age 65 to draw full Social Security benefits starting in the next decade. This is a sweetener for high-income beneficiaries who would now have to pay taxes on their benefits, but it would also help people with relatively modest earnings.

If, as seems likely, the Senate approves the measure this week, the conferees will be in a happy position. They will need only to reconcile relatively small differences between two measures, each of which is a basically fair and responsible approach to dealing with an issue that can, without qualification, be rated as the most politically sensitive one on the American scene.

Note also that this has been accomplished without round-the-clock floor battles and encampments of the elderly staked out in the halls of Congress-- and with admirable disregard for the million-dollar campaign of misleading argument launched by federal and postal workers' lobbies. It's enough to make you feel optimistic about the future of the republic.