Based on an unused script for an episode of the aborted series "Star Trek: Phase II", written around 1978.
The opening sequence, which shows Data performing Scrooge on the holodeck under Picard's watchful eye, is a nod to Patrick Stewart, whose 1988 stage adaptation of "A Christmas Carol" was a huge success (that he's remounted several times since, including A Christmas Carol (1999)).
This episode illustrates Arthur C. Clarke's Third Law: "Any sufficiently advanced technology is indistinguishable from magic."
First mention of Fek'lhr as being the "devil" in Klingon theology. Previously, in Day of the Dove (1968), the Klingon commander Kang told Captain Kirk that the Klingons "have no devil", although Klingons are known to exaggerate to seem tougher and Fek'lhr's role in the mythology (guarding the underworld, where the dishonorable or dishonored go when they die) is analogous to the Devil.
The title paraphrases a quote from William Shakespeare: "The devil shall have his bargain; for he was never yet a breaker of proverbs - he will give the devil his due." (Prince Hal in "Henry IV, Part 1" - Act 1, Scene 2)