The tip from Ben is correct. An asterisk is needed when the user exit is a grx instead of a dll. (And the double quotes should be omitted.)
The reason that the USER_RETRIEVE will not work and that the menuscript post action will work is based on the timing of the respective actions.
USER_RETRIEVE executes the custom program before NX opens the part. This allows the custom to completely replace the NX user interface for part selection if desired and potentially explicitly load parts directly or it can execute custom code and then (optionally) have NX perform the OOTB behavior. So, even if the environment variable is defined correctly the grip program would get executed too soon - there would not be a part open yet for it to modify. (Unless a new, more complex, Grip program were created that performed the file selection, the part open, and the attribute creation)
The menuscript "post" action executes once the part file has been opened where the GRIP program will successfully find part file to modify.
HTH, Joe