That code doesn't make sense. The only way you can do /mode # +o $me is if you are already an op, and if you are already an op, then there is no sense in setting +o on yourself. The only way to make a /opme command is if the network has a chanserv (or if the channel has a bot) and you can use that to op yourself. Additionally, I have no idea why you are checking if "G." is in the WHO reply, the flag is "G" means they are away, not "G." And as usual, I'm sure you know of some server out there that does this so I'll just quote from RFC1459:
352 RPL_WHOREPLY "<channel> <user> <host> <server> <nick> <H|G>[*][@|+] :<hopcount> <real name>"
Note how the flags are "H" or "G" not "H" or "G.". Furthermore, your code makes even less sense by assuming /away and not being online are the same thing, which is pure stupidity. If you want to tell if someone is online, you have to either use mIRC's built in /notify system, or use a /ison, not a /who. Oh and lets not forget you check if "G." is in $1-, which means if my realname is set to "greg." by your script, that is the same thing as be not being online.
Why don't you try actually testing your code before you post something that in reality, does NOTHING like what the poster requested.