Thanks again for your fast reply.
The script does not contain anymore errors. However, when I run it with the test-monkey, no additions that I made from your input are shown. The practice trials work perfectly fine, but the actual trials are neverending and do not show the recall-grid anymore after the amount of letters have been shown in correspondence with their set size.
This is the script of the blocks and the experiment:
<block PracLetter>
/ onblockbegin = [if(script.subjectid!="debug")
{text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=white; text.MathScore.textcolor=white; values.stopblock=0]
/ onblockend = [values.stopblock=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>
<block PracMath>
/ onblockbegin = [if(script.subjectid!="debug")
{text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
text.scoredebug.textcolor=white}]
/ onblockbegin = [values.mathaccuracy=0]
/ onblockend = [values.mathtimeout=(2.5*trial.prac_show_math.totalsdlatency)+trial.prac_show_math.totalmeanlatency]
/ onblockend = [values.stopblock=0]
/ stop = [values.stopblock==1]
/ trials = [1=prac_show_math]
</block>
<block PracBoth>
/ onblockbegin = [if(script.subjectid!="debug")
{text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ onblockend = [values.stopblock=0]
/ trials = [1=InitSetSize]
</block>
<block TestBoth_NonActing>
/ onblockbegin = [if(script.subjectid!="debug")
{text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>
<block TestBoth_Acting>
/ onblockbegin = [if(script.subjectid!="debug")
{text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
text.scoredebug.textcolor=white}]
/ onblockbegin = [text.MathFeedback.textcolor=black; text.MathScore.textcolor=red]
/ onblockbegin = [values.mathcurrenterrors=0; values.mathaccuracy=0; values.mathaccerrors=0;
values.mathtotalerrors=0; values.mathspeederrors=0; values.mathproblemcount=0;
values.lettercount=0; values.correctletters=0; values.currentsetsize=0;
values.recallcount=0; values.recalledletters=""; values.totalrecalledsets=0;
values.totalcorrectletters=0; values.ospan=0]
/ stop = [values.stopblock==1]
/ trials = [1=InitSetSize]
</block>
<expt AOSPAN>
/ onexptbegin = [if(script.subjectid!="debug")
{text.currentsetsize.textcolor=white; text.letterstrings.textcolor=white;
text.mathdebug.textcolor=silver; text.mathtimeout.textcolor=silver;
text.scoredebug.textcolor=white}]
/ blocks = [1=InstrPracLetter; 2=PracLetter; 3=InstrPracMath; 4=PracMath;
5=InstrPracBoth; 6=PracBoth; 7=InstrTestBoth; 8=TestBoth_NonActing; 9=TestBoth_Acting; 10=InstrFinal]
/onexptend = [values.completed = 1]
</expt>
And this is the script for the trials:
<trial InitSetSize>
/ ontrialbegin = [values.currentsetsize=0; values.lettercount=0; values.correctletters=0;
values.recallcount=0; values.recalledletters=""]
/ ontrialbegin = [if(script.currentblock=="PracLetter")
{values.currentsetsize=list.PracLetterSetSize.nextvalue}]
/ ontrialbegin = [if(script.currentblock=="PracBoth")
{values.currentsetsize=list.PracBothSetSize.nextvalue; reset(list.TestLetterList)}]
/ ontrialbegin = [if(script.currentblock=="TestBoth")
{values.currentsetsize=list.TestBothSetSize.nextvalue; reset(list.TestLetterList)}]
/ ontrialend = [clear(item.PresentedLetters); clear(item.RecalledLetters)]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ validresponse = (noresponse)
/ trialduration = 0
/ recorddata = false
</trial>
<trial show_letter>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>
<trial show_letter_nonacting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_nonacting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_nonacting, currentsetsize]
/ trialduration = values.learninginterval
/ validresponse = (noresponse)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>
<trial show_letter_acting>
/ ontrialbegin = [values.lettercount+=1]
/ ontrialbegin = [values.lightbulb_state = list.lightbulbstates_acting.nextvalue]
/ ontrialend= [item.PresentedLetters.item=text.Letters.currentitem]
/ pretrialpause = 200
/ stimulusframes = [1=BlackFrame, GrayFrame, Letters, lightbulb_acting, currentsetsize]
/ trialduration = values.learninginterval
/ inputdevice = keyboard
/ validresponse = (57)
/ branch = [if(values.lettercount==values.currentsetsize)trial.recall_letter]
/ branch = [if(script.currentblock=="PracLetter")trial.show_letter else trial.InitMathProblem01]
/ recorddata = true
</trial>
<trial recall_letter>
/ ontrialbegin = [values.recallcount+=1]
/ ontrialbegin = [if(values.recallcount==1)values.recalldelay=500 else values.recalldelay=0]
/ pretrialpause = values.recalldelay
/ stimulusframes = [1=WhiteScreen, F, H, J, K, L, N, P, Q, R, S, T, Y, _, clear, exit, recalledletters, recallprompt, letterstrings]
/ validresponse = (F, H, J, K, L, N, P, Q, R, S, T, Y, _, clear, exit)
/ monkeyresponse = ("F", "H", "J", "K", "exit")
/ ontrialend = [if(trial.recall_letter.response!="exit" && trial.recall_letter.response!="clear")
{item.RecalledLetters.item=trial.recall_letter.response; values.recalledletters=concat(values.recalledletters, trial.recall_letter.response)}]
/ ontrialend = [if(trial.recall_letter.response=="clear")
{clear(item.RecalledLetters); values.recalledletters=""}]
/ responsemessage = (F, clickF, 150)
/ responsemessage = (H, clickH, 150)
/ responsemessage = (J, clickJ, 150)
/ responsemessage = (K, clickK, 150)
/ responsemessage = (L, clickL, 150)
/ responsemessage = (N, clickN, 150)
/ responsemessage = (P, clickP, 150)
/ responsemessage = (Q, clickQ, 150)
/ responsemessage = (R, clickR, 150)
/ responsemessage = (S, clickS, 150)
/ responsemessage = (T, clickT, 150)
/ responsemessage = (Y, clickY, 150)
/ responsemessage = (clear, clickclear, 150)
/ responsemessage = (exit, clickexit, 150)
/ responsemessage = (_, click_, 150)
/ branch = [if(trial.recall_letter.response=="exit")trial.letter_feedback else trial.recall_letter]
/ recorddata = true
</trial>
<trial letter_feedback>
/ pretrialpause = 500
/ ontrialbegin = [values.correctletters=0]
/ ontrialbegin = [if(values.mathcurrenterrors>=3)values.matherrorswitch=2 else values.matherrorswitch=1]
/ ontrialbegin = [
if(item.RecalledLetters.item.1 != "" && item.PresentedLetters.item.1==item.RecalledLetters.item.1)values.correctletters+=1;
if(item.RecalledLetters.item.2 != "" && item.PresentedLetters.item.2==item.RecalledLetters.item.2)values.correctletters+=1;
if(item.RecalledLetters.item.3 != "" && item.PresentedLetters.item.3==item.RecalledLetters.item.3)values.correctletters+=1;
if(item.RecalledLetters.item.4 != "" && item.PresentedLetters.item.4==item.RecalledLetters.item.4)values.correctletters+=1;
if(item.RecalledLetters.item.5 != "" && item.PresentedLetters.item.5==item.RecalledLetters.item.5)values.correctletters+=1;
if(item.RecalledLetters.item.6 != "" && item.PresentedLetters.item.6==item.RecalledLetters.item.6)values.correctletters+=1;
if(item.RecalledLetters.item.7 != "" && item.PresentedLetters.item.7==item.RecalledLetters.item.7)values.correctletters+=1;
if(item.RecalledLetters.item.8 != "" && item.PresentedLetters.item.8==item.RecalledLetters.item.8)values.correctletters+=1;
if(item.RecalledLetters.item.9 != "" && item.PresentedLetters.item.9==item.RecalledLetters.item.9)values.correctletters+=1;
if(item.RecalledLetters.item.10 != "" && item.PresentedLetters.item.10==item.RecalledLetters.item.10)values.correctletters+=1;
if(item.RecalledLetters.item.11 != "" && item.PresentedLetters.item.11==item.RecalledLetters.item.11)values.correctletters+=1;
if(item.RecalledLetters.item.12 != "" && item.PresentedLetters.item.12==item.RecalledLetters.item.12)values.correctletters+=1]
/ ontrialbegin = [if(values.correctletters==values.currentsetsize)
{values.ospan=values.ospan+values.correctletters; values.totalrecalledsets+=1}]
/ ontrialbegin = [values.totalcorrectletters=values.totalcorrectletters+values.correctletters]
/ ontrialend = [values.mathcurrenterrors=0]
/ ontrialend = [if(script.currentblock=="PracLetter" && list.PracLetterSetSize.unselectedcount==0)
{values.stopblock=1}]
/ ontrialend = [if(script.currentblock=="PracBoth" && list.PracBothSetSize.unselectedcount==0)
{values.stopblock=1}]
/ ontrialend = [if(script.currentblock=="TestBoth" && list.TestBothSetSize.unselectedcount==0)
{values.stopblock=1}]
/ stimulusframes = [1=WhiteScreen, LetterFeedback, MathFeedback, MathScore, scoredebug]
/ validresponse = (noresponse)
/ trialduration = 2000
/ branch = [trial.InitSetSize]
/ recorddata = true
</trial>
<trial prac_show_math>
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, PracMathProblem, PracMathPrompt]
/ validresponse = (lbuttondown)
/ branch = [trial.prac_solve_math]
/ recorddata = true
</trial>
<trial prac_solve_math>
/ ontrialend = [values.mathaccuracy=round(((values.mathproblemcount-values.mathtotalerrors)/values.mathproblemcount)*100)]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, PracMathAnswer, TRUE, FALSE]
/ validresponse = (TRUE, FALSE)
/ correctresponse = (list.PracMathCorrect.nextvalue)
/ responsemessage = (anyresponse, PracMathAnswer, 800)
/ correctmessage = true(correcttext, 800)
/ errormessage = true(incorrecttext, 800)
/ branch = [if(trial.prac_show_math.trialcount >= list.PracMathList.itemcount)
trial.prac_math_feedback else trial.prac_show_math]
/ recorddata = true
</trial>
<trial prac_math_feedback>
/ ontrialend = [values.stopblock=1]
/ pretrialpause = 500
/ stimulusframes = [1=WhiteScreen, PracMathFeedback]
/ validresponse = (lbuttondown)
/ recorddata = false
</trial>
<trial InitMathProblem01>
/ ontrialbegin = [values.tmp_initmath01+=1]
/ ontrialbegin = [if(values.tmp_initmath01==1)
{values.tmp_mathopt01=list.MathOpt01.nextvalue;
values.tmp_mathsign=list.MathSign.nextvalue;
values.tmp_mathopt02=list.MathOpt02.nextvalue;
values.mathcorrect=list.MathCorrect.nextvalue;
values.tmp_mathopt02sign=concat(values.tmp_mathsign, values.tmp_mathopt02);
values.tmp_mathopt02sign=evaluate(values.tmp_mathopt02sign)}]
/ ontrialbegin = [if(values.tmp_initmath01>1)
{values.tmp_mathopt02sign+=3;
values.tmp_mathopt02=abs(values.tmp_mathopt02sign)}]
/ ontrialbegin = [if(values.tmp_initmath01>1 && values.tmp_mathopt02sign>0)
values.tmp_mathsign="+"]
/ ontrialend = [values.mathanswer=evaluate(text.MathProblem.currentitem);
values.mathtrueanswer=values.mathanswer]
/ branch = [if(values.mathanswer<0)trial.InitMathProblem01]
/ branch = [if(values.mathanswer>=0 && values.mathcorrect=="TRUE")trial.show_math]
/ branch = [if(values.mathanswer>=0 && values.mathcorrect=="FALSE")trial.InitMathProblem02]
/ trialduration = 0
/ validresponse = (noresponse)
/ recorddata = false
</trial>
<trial InitMathProblem02>
/ ontrialbegin = [values.tmp_initmath02+=1]
/ ontrialbegin = [if(values.tmp_initmath02==1)values.tmp_mathrand=list.MathRand.nextvalue]
/ ontrialbegin = [if(values.tmp_initmath02>1)values.tmp_mathrand+=2]
/ ontrialend = [values.mathanswer=evaluate(text.MathProblem.currentitem)+values.tmp_mathrand]
/ branch = [if(values.mathanswer>=0 && values.mathanswer!=values.mathtrueanswer)trial.show_math else trial.InitMathProblem02]
/ trialduration = 0
/ validresponse = (noresponse)
/ recorddata = false
</trial>
<trial show_math>
/ ontrialbegin = [values.tmp_initmath01=0; values.tmp_initmath02=0;
values.mathproblemcount+=1]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathProblemDisplay, TestMathPrompt, mathtimeout]
/ validresponse = (lbuttondown)
/ timeout = values.mathtimeout
/ ontrialend = [if(trial.show_math.response!="lbuttondown")
{values.mathcurrenterrors+=1; values.mathspeederrors+=1; values.mathtotalerrors+=1}]
/ branch = [if(trial.show_math.response!="lbuttondown")trial.show_letter else trial.solve_math]
/ recorddata = true
</trial>
<trial solve_math>
/ ontrialend = [if(trial.solve_math.correct==0)
{values.mathcurrenterrors+=1; values.mathaccerrors+=1; values.mathtotalerrors+=1}]
/ ontrialend = [values.mathaccuracy=round(((values.mathproblemcount-values.mathtotalerrors)/values.mathproblemcount)*100)]
/ pretrialpause = 500
/ stimulusframes = [1=BlackFrame, GrayFrame, MathAnswer, TRUE, FALSE, mathdebug]
/ validresponse = (TRUE, FALSE)
/ correctresponse = (values.mathcorrect)
/ branch = [trial.show_letter]
/ recorddata = true
</trial>
All help is appreciated :)