“The West Wing” creator Aaron Sorkin, 39, will be permitted to enter a two-year drug treatment program in lieu of serving prison time for possession of cocaine and hallucinogenic mushrooms. The Emmy winner pleaded not guilty last month to drug possession charges stemming from an April 15 arrest at California’s Burbank Airport. But to gain admission to the “Deferred Entry of Judgement” program (and skirt nearly four years behind bars and a maximum $10,000 fine), Sorkin entered a guilty plea to two felony counts and a misdemeanor during a court hearing in Burbank Superior Court on Tuesday. Initially he had entered not guilty pleas. “Needless to say, it is a relief to have a resolution regarding my legal situation,” he said. “I fully intend to proceed as directed by the court and am eager to get back to work and focus on what’s important.” A Dec. 3 hearing has been set to check on Sorkin’s progress.