In quantum mechanics, entanglement is more about the fact that until a measurement is performed on one of the balls, both balls are simultaneously blue and red and will behave as if it was in a superposition of both colors up until a measurement is performed. By extension, any other property that depends on the color of those balls will also be entangled with the balls and behave in a superposition of whatever properties are entangled.
For example if a washing machine washes clothes with hot water if the blue ball is in box A, and washed with cold water if the blue ball is in box B, then that washing machine will be washing clothes with hot and cold water until a measurement is performed on any of the balls or the washing machine itself. The clothes being washed will simultaneously be expanding (from hot water) and contracting (from cold water).
Only once a measurement is performed on any part of the entangled system will every property of the system collapse into a definite state of red or blue, hot or cold, expanded or contracted.
How can we know anything about quantum entanglement when measuring the entangled particles, or any effects they have, cause the whole thing to collapse?
Arguably the information that you "gained" was predetermined when you decided which colored ball to place in which box. You didn't gain any knowledge that you couldn't have known before you were teleported 5,000 ly away.
What's also more difficult is that the balls wouldn't have definitive colors, but exist in a probabilistic state / superposition. But you couldn't send the message "I have a red ball" to the individual 5,000 ly away because collapsing your ball's wave will be random and you can't determine which color you want. You could "mistakenly" collapse your ball to blue, not red.
* There is one theory of QM that removes the possibility of choice from the universe.
You look inside your box and see a red ball. In that moment you learn that I have a blue ball in my box. You gained that information in an instant, about a box 5,000 light years away.
(This is an explanation I've heard. But I don't personally know if it's accurate.)