You're fighting with #findindex, let it do the work for you:
finditem IS G
if #FINDCNT > 0
{
for #FINDINDEX 1 #FINDCNT
{
event property #FINDID
if reagent_vendor in #PROPERTY
{
; do it!
}
}
}
finditem maintains a list of the last known items that met your search criterion. #FINDCNT tells you how many were matches. You can iterate through the list with #FINDINDEX. #FINDITEM is automatically updated when you change the value of #FINDINDEX.