How do you keep heat from entering or escaping from a sealed box?
Heat may enter or escape the box, just keep in mind that the energy to heat it come from outside the box.
Is the universe a closed system? How can it be when it is expanding?
It is just a very big box.
The earth is considered a closed system, if you ignore meteor showers and harmful radiation from outside our "closed system".
And is the earth gaining or losing mass?
However, here again you are not responding to all that I post. How can time be different for those is spacecraft A versus sapcecraft B, and how do you explain how a person traveling at a constant 1G acceleration can live billions of orbital years?
I already told you that this is over my head, ask in again in 2 years.