Hints:
find_ent_by_owner, string is empty if !string[0], string[0] = 0 or string[0] = '^0' to empty string.
You should understand that command execution or menu keypress doesn't necessarily mean that buying will be performed. Therefore your plugin is incompatible with the AMX Mod X Restrict Weapons Plugin, plus, there is an issue with overriding old-style buy menu by other AMX Mod X registered menu.
As for your second idea i'd register FM_MessageBegin (see fakemeta.inc and fakemeta_const.inc).
Also there is a simple method of WeapPickup/Money messages gametime check, though the second way would be more accurate.