I've dealt with a similar situation, and found that the orphaned processes could be identified by examining lsof output, because they lacked stdout (file descriptor 0).
If you have lsof installed, you can check a known orphan's files with "lsof -p <pid>". If it has no entry with 0u in the FD column, this could be the way for you to identify them. The -c option was used in our case, because the orphans we were getting were all of one particular program.
I'd post the script, but process reaping is best developed on a case by case basis, with plenty of testing.
Rod Knowlton
IBM Certified Advanced Technical Expert pSeries and AIX 5L
CompTIA Linux+
CompTIA Security+