It's very simple. You just test on an "if" line whether the pattern was found or not, then you do echo or printf to print a message. Something like
Code:
if [ `grep someword somefile|wc -l` -gt 0 ] ; then echo "pattern found"; else echo "pattern not found"; fi
If you have to put it like right in the file, just use sed and replace the string by itself plus some line.