Chief O'Brien's fantasy was going to be a leprechaun, but Colm Meaney refused to give in to clichés about his Irish heritage. He remembered his irritation with the portrayal of Irish people in Up the Long Ladder (1989), but, now had the clout to insist on script changes, so he had the creature changed to the German imp Rumpelstiltskin. This recalls a change to one of the first Trek productions The Naked Time (1966), where George Takei, wishing to avoid clichés about the Japanese, insisted that Sulu's alternate personality be changed from a Samurai to a Frenchman.
The title is based on the Scottish proverb: If wishes were horses, beggars would ride.
Baseball player Buck Bokai's line "It ain't over 'til it's over" is a quotation of famous New York Yankees catcher Yogi Berra, who was referring to the 1973 pennant race. Berra, famous for his malapropisms and quirky sayings, was also famous for having claimed, "I didn't really say everything I said."
The baseball which Sisko keeps on his desk for the remainder of the series is a memento of this episode, given to him by the alien who impersonated Bokai.
Colm Meaney reflected that the episode was "very difficult to shoot because we had the appearing and the disappearing. The guy who played Rumpelstiltskin would appear to be behind my back, sitting on a console. But I had to play it in the completely opposite direction. So, he spoke from behind me, but I played the response in front of me. Then we had to reverse it and shoot it the other way. It was very complicated, but it came out well".