I think I understand, and have found a script but am having trouble setting a variable to cache the account name for the find.
I created a new script and am using the edit script feature. I am at the second step Set Variable but I do not see a way to set Substitute. All I can seem to create is Set Variable [$name; Value:( Get (AccountName))].
Any ideas? I included the script and a screen shot of the script editor.
Set Error Capture [On]
Set Variable [ $name; Substitute (Get ( AccountName ) ) ]
Enter Find Mode 
Set Field [ < field you want to search> ; $name ]
Perform Find 
If [ Get (FoundCount) = 0 ]
Show Custom Dialog [ "Warning" ; "No Records Found" ]
Set Error Capture [Off]
No need for any variable with this scripted method. And Substitute? why would you use that function here?
Enter find mode  ---> clear the pause check box. It isn't cleared in your script example
Set Field [T17_Staff::Name_ ; Get ( accountName ) ]
Set Error Capture [on] --> should come BEFORE the perform find. It keeps the "no records found" dialog from interrupting your script if none are found.
When Setting up Set Field, there are two Specify buttons that must be clicked. To get Set Field [Table::Field ; Expression], add set field to your script and click the first button (specify target field). Select Table::Field from the list of fields. Do not click the specify button next to the repetition box. Click OK to close this dialog box. Now click the lower specify button (calculated result) and create the expression to the right of the semicolon (;). Do not try to type in the semicolon.