You know, you really need $fline to work for this to work really well...
But, here's a way without using that since you couldn't get it working...
alias removelines {
if ($1 != $null) {
var %c = 1
var %i = $line(@test,0)
while (%c <= %i) {
if ($gettok($line(@test,%c),1,32) == $1) {
dline @test %c
}
else inc %c
}
}
}
Use: /removelines test
Note that I put the inc in an else because if you remove a line, you don't want to increase the counter.