I think I know what is wrong. Your event is running twice because you don't clear your state info on resetting. You can test this easily to assign an alertbox in your event and see how much times it pops up.
Add this as an theEvent case:
3: BEGIN
result:= GetCustomObjectInfo(objName,objHd,objrecHd,wHd);
vsoStateClear(objHd);
END;