Have you actually tested it?
<HGDSGU> !add
<Collective> HGDSGU set
<HGDSGU> !read HGDSGU
<Collective> user not found.


Let's say that "%name.of.user." was equal to "moo" (i.e. /set %name.of.user. moo)
if (%name.of.user. $+ $2 == 1) is not if (%name.of.user.bob == 1)
if (%name.of.user. $+ $2 == 1) is if (moobob == 1)

Your code is wrong, DaveC is correct.