A: Well, I can't exchange goods without a receipt.

B: Look -- this is the right box but the wrong CD. All I want is the right
CD.

----------------
What is the function (role) of the dash(--) in the sentence?

The dash is just providing a slight break in thought and a pause in speech.

I'd punctuate that answer with an exclamation mark, though.

Look! This is the right box ...