You'll run into problems using a variable (or datagroup) name with a hyphen in TCL:
% set ::test-var 10
10
% puts $::test-var
can't read "::test": no such variable
% puts ${::test-var}
10
You could either reference the variable with curly braces or just change it to an underscore.
And if the iRule isn't working, try adding logging to it. This should help you trace which code is actually executing. If you get stuck in your troubleshooting, reply here with details on what isn't working.
You can post your iRule with the [ code ] [/ code ] tags to preserve indentations.
Aaron