to define correctResp and trialCount go to View: Script, then click on the tab titled, User.
in this User tab, type:
Dim correctResp as Integer
Dim trialCount as Integer
then in your procedure timeline drag a Label Object to the very beginning. by default, this object will be called "Label1".
right after Label1 put your List Object from which you will call your trial procedure. by default, this will be called "List1".
inside List1 put the name of your procedure under the Procedure column.
now go to your procedure timeline. put in a TextDisplayObject (or whatever) to display your stimulus. call this TextDisplayObject "Stimulus".
double click on Stimulus, go to the Duration/Input tab, add a Keyboard response. fill in the blank where it asks for a correct response. if you don't define what a correct response to the Stimulus is, our next step won't work properly.
for the next step, drag an InLine object to the trial procedure immediately following Stimulus. by default, this will be called "Inline1".
in Inline1 type:
trialCount = trialCount + 1
If Stimulus.ACC = 1 Then
correctResp = correctResp + 1
End If
now on the same level as your List1, and your Label1, put another InlineObject ("Inline2").
in Inline2 type:
If correctResp/trialCount*100 <= 80 Then
Goto Label1
End If
hope that helps.