A federal grand jury in New York City yesterday indicted Twentieth Century-Fox Film Corp. for allegedly forcing movie theaters to show a less popular film in order to obtain the right to show its smash hit "Star Wars."

After the indictment, the giant motion picture producer entered a plea of nolo contendere (no contest) and was fined $25,000 plus the costs of the Manhattan.

The costs to be assessed specifically include the cost of the grand jury sessions - several over a one-year period - as well as travel by witnesses and others. The sum also will include the costs of the services of the three or four Justice Department attorneys involved in the case whose services will be assessed at rates private lawyers would charge for equilavent services if the judge agrees.

A Justice Department spokesman said the assessment plan is unusual but not unprecedented but he could not say how much the company will have to pay. "There is no way of telling right now but obviously it will be a substantial amount," he said.

The indictment charged Twentieth Century-Fox with one count of criminal contempt for engaging in "block-booking" in violation of a 27-year-old court order prohibiting it.

Under the practice of block-booking, a film distributor requires an exhibitor to take one or more films that are usually not in demand in order to get the right to show another - usually highly popular - feature film.

According to the indictment, Twentieth Century-Fox entered into a number of licenses which required movie theaters to take "The Other Side of Midnight" in order to obtain "Star Wars," the highest money making motion picture of all time. The challenged licenses were negotiated by Twentieth Century-Fox's Boston and Minneapolis branch offices during the summer and fall of 1977, the indictment alleges. Both films were first shown in late May and early June of that year.

The government contended the licenses violated the terms of a 1951 consent judgment signed by Twentieth Century-Fox and other major movie makers. In addition to Twentieth Century-Fox, Columbia Pictures, United Artists, Paramount Pictures, Universal, MGM, and Warner Brothers are also currently covered by the judgment.

The judgment settled issues remaining from a 1938 government suit charging major motion picture companies with monopolizing and conspiring to restrain interstate trade in the production, distribution and exhibition of motion pictures.

The judgment had been entered after a trial on the merits in the district court and a review by the U.S. Supreme Court which affirmed parts of the court decision and sent others back, and the consent of the parties on the issues left open.

In a statement, Twentieth Century-Fox noted that a no-contest plea is not an admission of guilt and said the complaints related to a few isolated incidents occurring in only two of Fox's 26 exchanges.

"To the extent that any incidents of block-booking may have occurred, they would have been clearly contrary to the company's long-standing policy of strict compliance with the consent decree which has been consistently followed over the year," the company said.

It added that none of the company's higher management personnel had been aware of the alleged incidents. Since the complaints came to the management's attention, its compliance program has been strenghened, Fox said.