This will work but it does not validate that the map exists. The only error checking I added was to check that the map must be more than 4 characters and the last 4 characters must be ".bsp"

Code:
on 1:TEXT:!map *:[color:red]#YourChannel[/color]:{
  if ($len($strip($2)) > 4 && $right($strip($2),4) == .bsp) { rcon map $strip($2) }
}