As you mentioned, photons in the box have quantised momenta based on the fact that they are standing waves, with an integer number of half wavelengths.
$\lambda = \frac{n}{2L}$
$p_n = \frac{h}{\lambda} = \frac{2hL}{n}$
There are photons of all allowed momenta in the box. Which momenta are allowed is determined by the expression for $p_n$ above, where n is all possible integers. So for a macroscopic system where L is much, much larger than $\lambda$, we can think of $\lambda$ as being a function of a continuous variable where, rather than being an integer, n can take on all any value (basically, we can ignore the step-like nature of $\lambda$).
For a photon gas (a type of Bose gas with zero chemical potential), the mean energy can be found using:
$\overline{E} = \sum_i E_i \overline{N}_i$
Where $\overline{N}_i$ is the average number of particles which occupy a state with energy $E_i$. I'm not sure how much you know about statistical mechanics but for a photon gas $\overline{N}_i$ is:
$\overline{N}_i = \frac{1}{e^{E/kT}-1}$
We also know that for a photon:
$E_i= pc$
And so because we have concluded that we can approximate the allowed momenta as a continuous function of n this sum of $E_i N_i$ becomes an integral, which is a lot easier to solve!
The result is:
$\overline{E} = \frac{\pi ^2 (kT)^4 V}{15(\hbar c)^3}$
Wow! The mean energy of the photon gas depends on $T^4$ and the volume... the important thing here is that this is the mean energy of the photon gas as a whole. If we divide by V we get the energy density, which only depends on $T^4$. This is an important result: the energy density in a black body cavity is only dependent on the temperature. We could take that energy per unit volume, which is carried by many photons with a broad spectrum of energies, and think of it as simply the energy of a single photon of frequency f:
$f = \frac{E_{density}}{h}$
Therefore our box at temperature T would consist of a number of photons, all with energy $E_{density}$. This energy is independent of volume and depends only on temperature, but the number of these photons in the box is dependent on the volume. It is the frequency of these hypothetical photons which determines the colour of light we see emitted from the box and it is independent of the volume. So a larger box (or larger opening) would simply allow more energy per unit time to escape, so the intensity of the radiation would be greater, but the colour of the light would be unaffected.
This photon with energy $E_density$ is purely hypothetical, but it is a useful pedagogical tool. The full blackbody spectrum, as devised by Plack, is given by:
$I = 2kT\frac{f^2}{c^2} \frac{hf/kT}{e^{hf/kt}-1}$
Where I is intensity. This is independent of volume.
I hope this makes sense.