I can't really tell where it's coming from either, as I can't see your input, and without that, can't follow your logic.
It'd be much easier to control it though, if you weren't running awk | sed | cut | fold | kitchen | sink, just running one awk instead. One process to exclude instead of 9.
Post your input, and post the output you want, please.
I've seen the output you want, but not the input. So I will take a wild uninformed guess at what you actually want and hope that ps -aef looks the same on my system as yours:
# Apache's PID is 10820
$ ps 10820
PID TTY STAT TIME COMMAND
10820 ? Ss 0:28 /usr/sbin/apache2 -D INFO -D SSL -D LANGUAGE -D PHP5
# So, list all PIDs where PPID, col 3, are 10820
$ ps -aef | awk -v PARENT="10820" '$3 == PARENT { print $2 }'
19832
20286
20304
20305
25669
25690
25692
25693
25694
25770
30264
# This time, put them in an array
$ ARRAY=( `ps -aef | awk -v PARENT="10820" '$3 == PARENT { print $2 }'` )
$ echo ${ARRAY[0]}
19832
$ echo ${ARRAY[1]}
20286
$
By hunting for meaningful values rather than blind text matches, all the grep -v | grep -v | grep -v | grep -v | grep -v | grep -v | grep -v | grep -v can be avoided.
If it didn't have a parent PID of 12345, it wouldn't be extracted, I'm not convinced this is actually wrong.
If the process you're running happens to be a child of the process in question, it will appear as a side-effect of course. If all you want is your own children, you could just do ps -ef without the a, no?