Where do the words "is killed gracefully" in your expected output come from? There's nothing graceful about "kill -9".
Since you have already concocted a somewhat overly-complicated command (which I'm sure someone will take the time to simplify), you could simply add a grep -v GENE before the while
kill -9 kills a process abruptly
to cleanly kill a process kill -15 is used.
the difference between the two is,
kill -9 murders the process [doesn't care if it has any unfinished job], whereas
kill -15 requests the process to die hence, the process can finish it's unfinished jobs and die peacefulle [RIP :D]