very inefficient, and easily expanded http://www.hawkee.com/snippet/3082/ my sister made that, and honestly, its a lot better than yours, and i say that in the kindest way, just use it as insperation and ideas, also your dialog can easily be expanded to allow channel talking also:
On ^*:Text:*:%pm: {
if (%spm = on) {
if ($active = %pm) { did -a spm 1 $+(<,$nick>) says: $1- $crlf }
haltdef
}
}