Here you go.
on *:input:#: { if ($left($1,1) == /) { return } if ($istok(? ! .,$right($1-,1),32)) { haltdef | msg $chan $upper($left($1,1)) $+ $right($1-,-1) } else { haltdef | msg $chan $upper($left($1,1)) $+ $right($1-,-1) $+ $chr(46) } }