It's not working because you can't have identical events in your code more than once.
I see that you have introduced a group into your code. How is this group controlled?
I may have a better suggestion once you answer that question, but for now
Code:
#Auto on
on @*:text:!voice*:#:{
  mode $chan +v $iif($$2 ison $chan,$v1,$nick)
  .notice $vnick You Have Been Given Voice in #
}
on @*:text:!devoice*:#:{
  mode $chan -v $iif($$2 ison $chan,$v1,$nick)
  .notice $vnick You Have Been Given Devoice in #
}
#Auto end
on @*:text:!voice*:#:{
  mode $chan +v $iif($$2 ison $chan,$v1,$nick)
  .notice $vnick You Have Been Given Voice in #
}

Personally, I'd just go with the first two events that I posted here, and remove the group setting