Don't worry. I still don't quite have the hang of it all myself to be honest, but it seems to work as it should here so I'll do what I can to assist.
If I understand correctly, what you want is one child class and two leaf classes. One leaf class is designated to testing and the other leaf is for general traffic on the outbound interface. This should be achieved by removing all but two of the leaf classes and marking the packets with iptables as it seems you have done.
Make sure that the following statements matches your firewall rules:
To shape traffic leaving the router machines localhost, mark packets in the OUTPUT chain.
To shape traffic leaving another machine connected to the router, mark packets in the FORWARD chain.
One way to check if traffic is passing through your classes is to set both leaf classes 'bounded', restart tc and generate some traffic to see if the class rates are being obeyed. My favorite tool for this is 'iftop'.
Code:
iftop -P -B -i <ifname>
Another way to check if packets are passing through your classes is by poking tc every second or so for information.
Code:
watch -n 1 /sbin/tc -s -d class show dev eth0
Make sure your child class is 'bounded' during and after testing or the leaf classes will have no supreme overlord to obey. A class have to be 'bounded' in order to not exceed the specified rate limit. If they aren't bound, the child and leafs will borrow whatever bandwidth is available from the root qdisc.
I corrected a minor error in the script. Have a look at it and look for the underlined weight statements. This did however not affect the overall performance, at least as far as I have noticed.