Billy Don't Be a Hero blue, and "riding out" (cavalry) refer to the American Civil War. However the drum beat and cavalry "riding out" is not specific to the American Civil War, and blue uniforms were common in the 19th century. That being said, Paper Lace themselves performed the song on "Top of the Pops" wearing Union-style uniforms, as can be seen on YouTube. A young woman is distraught that her fiancé chooses to enlist with Army recruiters passing through the town, causing her to implore him: The song goes on to describe how Billy is killed in action in a pitched battle after volunteering
A Town Called Mercy looking to give each episode of the series a distinct feel, showrunner Steven Moffat pitched the Wild West theme to writer Toby Whithouse, suggesting that the episode could be about a town terrorised by a robot. Moffat was keen on putting Matt Smith in a Western setting, who he called one of the last people one would expect to replace Clint Eastwood. Whithouse had previously written the "Doctor Who" episodes "School Reunion" (2006), "The Vampires of Venice" (2010), and "The God Complex" (2011). Moffat had been planning for the first five episodes of the series to have "movie marquee" themes.