Depends if you use slime though. I'm guessing it'll still show the show flavor even if you didn't get infected, but not sure.
But if you check *.thisgene then you'll always know if it's no longer at the right spot. Shot flavor is not as reliable, you could get hit by 2 shots at the same time, and even when you catch it, you need to store it somewhere since shot flavor will change next time you get hit.
Just find a wide range of empty memory locations, and have each gene increment the location offset by it's gene nr, then when the last gene is no longer at the right spot you can check which memory location is no longer being incremented and delete that gene and reset all your counters.
Or if it's an IM/Evo bot you could just have a strong anti virus gene at the end and keep track of foreign viruses and use them as your own instead.