The short answer
The sentence is never spoken in Casablanca. Ilsa asks Sam to play it once for old times' sake, and then simply: play it, Sam — play As Time Goes By. Rick, later and far more roughly, tells him that if she can stand it, he can, and orders him to play it. The famous version splices the two and adds a word that neither of them uses.
Where the misquote actually comes from
Woody Allen's 1969 stage play, and the 1972 film made from it, were both titled Play It Again, Sam. The title was a knowing nod to a line audiences already half-remembered — and it did what a catchy title always does: it overwrote the original in the public memory. Most people now recall the play's title as though it were the film's dialogue.
Why the real lines are better
Because they are unequal. Ilsa's request is quiet and slightly pleading; Rick's is bitter, jealous, and delivered as an order. The same song, asked for twice by two people in completely different emotional states — that contrast is the scene. Play it again, Sam flattens both into one neutral, breezy phrase and throws away the drama that made the moment famous.
The pattern behind film misquotes
Cinema produces these constantly, and always the same way: the misremembered version is more self-contained. Real dialogue is written to be heard inside a scene, with context supplied by everything around it. Quoted alone it can sound incomplete, so memory quietly edits it into something that stands up on its own — adding a name, a word, a clarification. The improved version is easier to repeat and further from the truth.
What this means for your English
Notice what again does. Play it, Sam is an instruction; play it again, Sam implies shared history in a single syllable. English is full of these small words that smuggle in whole backstories — again, still, already, anymore. Using them precisely is how you say a great deal without adding a clause.