that's a completely terrible script
I will tell you why
first of all, you are doing a 0.1 second loop serverside, which is the worst idea ever if you can at all avoid it
you are comparing strings wrong
NPC Code:
if (strequals(#s(this.string),some text)) {
that is the kind of format you must use in GScript
third you are doing your loop using while and sleep, that's a horrible idea
use timeout for loops
fourth, this kind of thing should be integrated into whatever system you have for picking the gender in the first place
good luck with improving your scripting abilities, we all have to start from somewhere