On Jan. 31, the Social Security old-age fund, once a financial basket case, will pay the Medicare hospital trust fund $10.6 billion, completing repayment of funds it borrowed from Medicare in 1982 to stave off imminent bankruptcy.

And within the next few months, the old-age fund will repay the Social Security disability trust fund $2.5 billion, completing loans made from that fund during the same period.

In 1982 the old-age fund faced insolvency because the nation's economic conditions during the preceding five years were so much worse than had been projected that the schedule of income and outgo based on payroll taxes and benefit outlays was severely miscalculated.

At that time, the old-age fund was authorized to borrow $12.4 billion from the Medicare trust fund and $5.1 billion from the disability benefits trust fund to keep going. Interest was to be paid monthly until repayment.

In 1983, Congress approved a financial rescue plan for the old-age system, based on new Social Security taxes and a six-month cancellation of a cost-of-living increase.

The old-age fund repaid part of the loans a year ago, and the new payments will wipe out the remaining debt.

The system is now in better financial shape than had been predicted when the rescue plan was adopted.

Combined old-age and disability reserves were about $42 billion at the end of 1985, roughly $7 billion higher than the projected balance for that date.