I completely agree with RickerHK. Aside from some messed up indentation, its looks right. The only difference with my script (that works) is the nested DoOnce variable that prevents the ref walk stage from repeating the next frame, but setting the stage to 4 should do the very same thing.
Edit: Package up your mod and send it to me as an esp and tell me where to find these two scripts and I'll play with it. I think I recall that sometimes you need to set the rCurRef to something before the GetFirstRef command. Like 'Set rCurRef to Apple' or the like. I don't have that in my script, but I seem to recall that its needed sometimes to keep the code from borking. :shrug:
Edit: Package up your mod and send it to me as an esp and tell me where to find these two scripts and I'll play with it. I think I recall that sometimes you need to set the rCurRef to something before the GetFirstRef command. Like 'Set rCurRef to Apple' or the like. I don't have that in my script, but I seem to recall that its needed sometimes to keep the code from borking. :shrug:
Cipscis always puts in his examples - set the ref to something before calling GetNextRef
set rCurRef to Pencilset rCurRef to GetNextRef