One of Barnett Brettler’s favorite movies while he was growing up was the sci-fi action hit “Aliens.” Soldiers trying to escape from a planet infested with killer insectoid aliens — how could an imaginative boy not love that?

But the more he watched the movie through the years, the Long Island, N.Y. native realized that “Aliens” was about something much deeper than actress Sigourney Weaver gunning down and torching acid-blood-filled aliens. It was about motherhood — Weaver’s character, whose own daughter died years ago, rediscovering herself as she tried to protect an orphaned girl from vicious aliens.

”I was into horror and sci-fi because they seemed larger than life,” said the 25-year-old Brettler, who is completing his M.F.A. in screenwriting at the UCLA School of Theater, Film and Television. But the sci-fi movies that really drew Brettler in had a lot more going on than eye-popping special effects. “They tell small stories that are … buried within spectacle, and worlds that drive your senses and keep you focused.”

Brettler’s understanding of science fiction’s Trojan Horse storytelling tradition fueled his screenplay for “Waking Hours,” which recently won the Sloan Student Grand Jury Prize. The $50,000 prize is awarded annually by the Alfred P. Sloan Foundation to the best student screenplay in the nation that uses science and technology themes or characters to tell an engaging story. In addition to the prize money, Brettler also got to attend the Tribeca Film Festival in April in New York City, where he had one-on-one meetings with producers, managers and agents to discuss how to bring his script to the big screen ($20,000 of his prize winnings is earmarked to help make this happen). Brettler, who is scheduled to graduate in June with his M.F.A. in screenwriting, is the first UCLA student to win.

Said TFT professor Hal Ackerman, who has mentored Brettler, of his prize-winning script, “It has a fascinating and believable science premise, and it is a kick-ass story … a thriller with great characters in a breathtakingly powerful human situation.”

“Waking Hours” takes place in the near future during an outbreak of a disease, known as “Mr. Sandman,” that causes fatal sleeplessness. The story’s lead character is a British border agent whose job is to keep infected Middle Eastern refugees from entering England. But in the midst of the outbreak he abandons his job so that he can search for his ex-girlfriend, who may know the key to curing the disease. Wrapped in this disease-disaster movie, Brettler really has a love story.

“‘Waking’ Hours’ is a guy searching for a woman who rejected him, and while he’s doing this, the world is falling apart around him,” said Brettler, who last year was a winner at the TFT Student Screenwriters’ Showcase and is helping produce this year’s competition. The showcase is part of the TFT Film Festival that opens Friday, June 7.

Brettler started writing “Waking Hours” in March 2012, after he was one of 10 UCLA screenwriting students selected by TFT faculty to turn their story ideas into scripts for the Sloan prize.

”It felt like an exciting opportunity to do something I’d never done before,” Brettler said of the challenge of humanizing science. He said that he focused on writing the best script, never expecting that he would win — especially after spending six years prior to graduate school working as a script reader in the movie industry, during which he read more than 1,000 screenplays, including some great scripts that never became anything.

To help him maintain scientific accuracy that still served the plot, Brettler was paired with professor Imke Schroeder of the UCLA Department of Microbiology, Immunology and Molecular Genetics. Brettler based the movie’s sickness on Creutzfeldt-Jakob disease but changed it into a highly contagious, fast-spreading infection that initially causes sleeplessness, then madness and death. Schroeder suggested changing how the disease spreads from airborne to bodily fluids to so that measures taken in the script to control the disease would be more realistic.

“Highly contagious airborne diseases are very difficult to quarantine,” Schroeder said.

To further ensure that he got the science correct, Brettler read 11 books and more than 100 journal articles about transmissible spongiform encephalopathies — degenerative brain diseases like Creutzfeldt-Jakob, kuru and fatal insomnia — and how diseases are transmitted. He also researched scientists who studied these diseases and how they helped people infected by them — particularly those in poor areas similar to where some of “Waking Hours” takes place.

“The science was woven seamlessly into the storyline,” Schroeder said. “The disease was described with sophistication and logic without overwhelming the audience. Although the disease itself does not exist, it is based on enough basic science to sell it as a realistic new emerging thread to mankind.”

Yet in the early stages of writing the script, Brettler didn’t focus so much on scientific accuracy as on completing the story. He said that he was also afraid of interrupting the narrative with a boring eight-page scene in the middle of the movie that was just someone explaining the science.

Instead, Brettler lets the viewer learn the science the same way his main character, Owen, does, by retracing ex-girlfriend Isabel’s steps: Two years after she left him to help refugees infected by the outbreak, Owen learns that Isabel has been killed but then gets a call from her cell phone and decides to ditch his job to find her. During his search for Isabel, Owen and the viewer get a science lesson in infectious diseases disguised as a thriller.

Brettler wanted to set his story along a border between countries because, to him, borders represent an ethical gray zone. Having lived in London in 2008, Brettler chose Dover, England, which is the town closest to France across the English Channel. On the French side, refugees from the Middle East and Africa have spent years living in squalid squatters encampments hoping to someday get into England, despite British agents charged with keeping them out.

“Everybody, whether English border agents or Middle Eastern refugees, truly believes that they’re doing what they’re doing for a greater good,” said Brettler, who studied film as an undergraduate at Syracuse University. “The refugees are trying to escape from a hopeless situation for asylum and health care — for their families and loved ones. The agents are trying to keep them out to protect their country [and] their own families and loved ones.”

Drafts were due in June 2012. In October, Brettler found out that he won the competition among his fellow UCLA students, which was judged by UCLA screenwriting faculty, Sloan science consultants and the Sloan foundation in New York. He then revised his script and submitted it to the Sloan Foundation and the Tribeca Film Institute to compete against the winners from five other film schools across the country. This spring, Brettler learned that he won the grand prize.

Brettler said that winning thrilled his mother, who, while encouraging her son’s screenwriting ambitions, still jokes that law school would have been a good choice. Having grown up in a family of lawyers, Brettler at times entertained the prospect of a career in law, as well as medicine, architecture, politics and history. But writing has proven to be the ideal match, he said, because he gets to tell interesting stories about anything he’s interested in.

“Writing ‘Waking Hours,’ I became a neurologist for months,” he said. “Scientists have love and passions, and the coolest part about the Sloan is that you’re showing that love.”