The Independent Bankers Association yesterday asked a federal court to prevent a government regulation from taking effect that would bar officers of national banks from keeping commissions on sales of credit life insurance to borrowers at their banks.

The regulation, scheduled to go into effect Jan. 1, was issued by the Comptroller of the Currency to curb what his office considers "an unsafe and unsound banking practice."

A hearing on the motion has been set for Thursday in U.S. District Court, at which time the association will also ask the judge to declare the regulation invalid.

Credit life insurance protects a lender, in this case a national bank, against the possibility that a borrower might die or be debilitated before the loan is paid off.

For years it has been standard practice for officers, directors and major stockholders of small banks to act as agents for the insurance company and take a commission on all sales of credit life policies accompanying their loans.

The amounts involved reportedly are substantial and may run into the millions of dollars, although the Comptroller's office said it had no accurate total.

However, it cited the case of small bank president who doubled as the insurance company agent. His bank salary was $25,000, while his commissions amounted to $78,000.

The Comptroller, John G. Helmann, charged that the practice could result in a conflict of interest if a loan officer makes a bad loan in order to sell a credit life insurance policy in order to collect a commission. The Comptroller also charged that bank insiders use income from insurance to finance personal bank stock loans. This kind of dealing, his office said, can reduce the incentive to run a sound, profitable bank.

The new regulation would require agents to turn their commissions over to the bank. Alternatively, it would have the bank buy group credit life coverage where refunds of excess premiums are paid to the bank.

Last August a federal court in Galveston, Tex., ruled that income from credit life insurance sales must be turned over to the bank by agents.The case involved five banks controlled by the family of Charles R. Vickery Jr.

In the complaint filed yesterday, the bankers' association claims that it 1.950 national bank members would incur substantial costs by buying group policies and would therefore be forced to operate at an economic dsiadvantage to their state bank competitors.

The Federal Deposit Insurance Corp., which has jurisdiction over insured state banks which are not part of the Federal Reserve System, has taken a different approach to the problem.

In 1975 it ruled that a credit life insurance agency which is not owned by the bank may be operated on the bank's premises with the agency owner being allowed to keep the profits on such policies.

Both the Independent Bankers Association and the Comptroller's office refused yesterday to comment on the suit.