ON A small, green planet called Earth, hidden away in a labyrinthine complex of gray buildings, computer programmer Ann Crispin looks away from her computer screen and drifts off into another universe.

Crispin, a programmer at the U.S. Census Bureau in Suitland, is also a science-fiction novelist, and when she occasionally daydreams at her decidedly terrestrial job, she leaves the world of facts and fractions for fantasy, dreaming up strange scenarios for her next plot twist.

Crispin, 33, is living a fantasy held by many aspiring writers--her first novel, "Yesterday's Son," submitted over the transom to Pocket Books, was published Aug. 1 and entered The New York Times mass market paperback list last week at number 14. Sporting a cover by the popular fantasy artist Boris, "Yesterday's Son" is the first Star Trek novelization to make the chart that was not a movie tie-in.

"Yesterday's Son" was Crispin's first attempt at writing, not counting, she says, "the kind of stuff everybody turns out in high school--lots of adolescent poetry and really junky stuff." She spent 2 1/2 months on the first draft, and went through five drafts over a year, while working a 40-hour week for the government.

The seed for the story was a Star Trek episode called "All Our Yesterdays," in which the supremely rational Spock, who has traveled 5,000 years into the past to the planet Sarpeidon, meets up with a woman named Zarabeth (Mariette Hartley). He reverts to a more primitive consciousness, they embrace and--COMMERCIAL BREAK.

"The book is about the aftermath of that two-minute commercial break," Crispin says. "Two years later, Spock is looking at some architectural photos and sees a Vulcan face painted on a cave wall, and he says 'Oh my God!' or words to that effect. The painter was his illegitimate son, of course, and being a duty-ridden Vulcan, he feels responsible and arranges to travel back in time to bring his son into the present."

Although Crispin follows Star Trek closely, she doesn't consider herself a "Trekkie." "Once you start making money at it, you're out of that category," she says. "Now I'm something more dignified, a 'Trekker,' maybe." She received a $5,000 advance from Pocket Books, plus a 2 percent royalty, "pretty good for a first novel," she says.

Crispin says she's been a sci-fi fan since childhood. "I went through all the horse books in the library by the time I was 10 years old, and one day I managed to pick up one of those old Donald Wollheim editions with the rocket on the spine. They had titles like 'Teenagers Going to the Stars,' 'Marooned on Mars,' 'Missing Men of Saturn' . . . Then I learned about Andre' Norton and Robert Heinlein, and went through all the science fiction in the library."

Crispin is currently collaborating on a novel with Norton, a hero of her teen-age years who she began corresponding with years ago. "I've always been wedded to her universe. I wrote her about a dream I had about her universe, and she wrote back saying, 'What a great story idea!' " Crispin is finishing a first draft of that dream, called "Gryphon's Eyrie," the third in Norton's "Crystal Gryphon" trilogy.

Although Crispin's flights of fancy take her to faraway places, she says she confines her interplanetary travel mostly to a small study in her Hughesville home, where she also tends to more mundane matters. She lives there with her husband Randy, a pharmacist, and 4-year-old son Jason, to whom "Yesterday's Son" is dedicated. She also attempts to answer her fan mail, which is already coming in at a rapid clip.

Crispin says she is taking an unpaid leave of absence from the Census Bureau so she can write full time. A contract is pending with TOR Books (Thomas Doherty Associates) to write the novelization of the upcoming NBC sci-fi mini-series "V," plus two novels next year. She also has a contract with Pocket Books for another Star Trek novel, which she will begin writing as soon as Paramount Pictures, "who owns everything that goes into the Star Trek universe," approves her storyline.

"Writing is a wonderful release, going from one universe to another," Crispin says. "But the commute is hell."