Typos. You're calling undefined variables %n.word and %t.bnick.
try this (untested)
Code:
on *:text:!listbadword:#:{
if ($nick isop $chan) {
var %t.bword = $ini(sysbadword.ini,$chan,0)
while %t.bword > 0 {
set -u0 %n.bword $addtok(%n.bword,$ini(sysbadword.ini,$chan,%t.bword),32)
dec %t.bword
}
notice $nick %n.bword
}
}