Huh? You are misunderstanding about the equation for CPU scheduling...
The average waiting time is the total waiting time of all processes divide by the total number of all processes. It is not your 'queue' size at all. Using queue time will be very dangerous and can be easily inaccurate.
/*
For example
process required process time arrival time unit
p1 10 0
p2 12 7
p3 7 9
Ignoring the CPU burst, now the process will be put into scheduling as...
0 10 20 30
|---------|---------|---------|-----
| | | |
p1 p2 p3 end
Now compute the waiting time...
p1 -> arrives and starts => 0
p2 -> arrives at 7 but waits until 10 to start => 3 (10-7)
p3 -> arrives at 9 but waits until 22 to start => 13 (22-9)
w = (0 + 3 + 13) / 3 <-- total waiting time / total number of process
*/