Don't use grep! The man page for ps has exactly what you need. This will give you the pid for named:
NAMEDPID=$(UNIX95=1 ps -C named -o pid tail -1)
If $NAMEDPID has just PID, then named is not running. Otherwise, NAMEDPID has the named process ID.
However, this is way too complicated to locate named since it maintains it's own file with it's pid: /var/run/named.pid (man named)
Bill Hassell, sysadmin