I hate \"|\" when I see how they\'ve been used here. :(
They can cause many stupid errors while there\'s simpler and clearer ways to do :).
So first issue, in the \'unset\' command, you wrote: \"unset goodbye\". Must be \"unset %goodbye\".
Second issue, for the sex thing, you refer to the file sex.ini to count and append but later refer to some ryanon.ini file to msg the number of times for the same thing ... That will definitely not work.
Not using pipes \"|\" would probably have avoided those errors ;).
Regards