OK, perhaps I'm confusing myself a bit here, and not being clear about the meaning of W. As Irlanur suggests, maybe it's not as straightforward as it sounds.
Let's consider the case of a simple diatomic rotor. The energy levels are E
J = BJ(J+1) and the multiplicities are n
J = 2J+1. Let's assume for simplicity that levels above J = 1 are not thermally accessible, to a significant extent, at temperatures of interest.
Consider the states a molecule may occupy. There is just one way it can occupy level 0, with m
J = 0. There are 3 ways it can occupy level 1, with m
J = 1, 0 or -1. So W
0 = 1 and W
1 = 3, and ΔS
01 = k ln 3.
For a mole of molecules ΔS = R ln 3. This is the difference between the molar entropies of the two states - i.e. between the state where all molecules are in level 0, and the one where all molecules are in level 1. Likewise ΔS° for a reaction such as A
B is S°(B) - S°(A), i.e. the difference between all-B and all-A. We are not yet considering an equilibrium distribution of the molecules
between the states.
This value of ΔS (to a first approximation, for the case of the chemical reaction) does not change with temperature. You can see that W
0 = 1 and W
1 = 3 irrespective of temperature or occupancy. What changes with temperature is the entropy of the
system as the occupancy of the levels changes. If at T
1, 1% of the molecules are in level 1, and at T
2 the fraction is 5%, then W(system) is greater at T
2 than at T
1 because there are more ways of producing this arrangement.
In the chemical reaction, the entropy of the system at equilibrium is S = x
AS°
A + x
BS°
B. The entropy of the system changes with temperature because x
A and x
B change.
I hope that hasn't made things too complicated!
{Note: d ln K / dT = d(- ∆H°/RT + ΔS°/R) / dT = ΔH°/RT
2 - 1/RT dΔH°/dT + 1/R dΔS°/dT
But dΔH°/dT = ΔC
p and dΔS°/dT = ΔC
p/T, so the last two terms cancel out. Thus any variation of ΔS° with T doesn't affect K.}