FWIW, if you wanted to limit the max. recall time allotted per each square (i.e., each run of <trial recall_square>) instead of limiting the overall recall time allotted for a given set of squares, the modifications are quite simple:
<trial recall_square>
/ ontrialbegin = [values.recallcount+=1; values.squarenumber+=1]
/ ontrialbegin = [if(values.recallcount==1)values.recalldelay=500 else values.recalldelay=0]
/ pretrialpause = values.recalldelay
/ stimulusframes = [1=WhiteScreen, matrixbg, R1C1, R1C2, R1C3, R1C4, R2C1, R2C2, R2C3, R2C4,
R3C1, R3C2, R3C3, R3C4, R4C1, R4C2, R4C3, R4C4, _, clear, exit, recallprompt, squarestrings]
/ validresponse = (R1C1, R1C2, R1C3, R1C4, R2C1, R2C2, R2C3, R2C4, R3C1, R3C2, R3C3, R3C4, R4C1, R4C2, R4C3, R4C4, _, clear, exit)
/ monkeyresponse = (R1C1, R1C2, R1C3, R1C4, exit)
/ ontrialend = [if(trial.recall_square.response!="exit" && trial.recall_square.response!="clear")
{item.RecalledSquares.item=trial.recall_square.response}]
/ ontrialend = [if(trial.recall_square.response=="clear"){clear(item.RecalledSquares); values.squarenumber=0;
text.R1C1.textbgcolor=(white); text.R1C2.textbgcolor=(white); text.R1C3.textbgcolor=(white);
text.R1C4.textbgcolor=(white); text.R2C1.textbgcolor=(white); text.R2C2.textbgcolor=(white);
text.R2C3.textbgcolor=(white); text.R2C4.textbgcolor=(white); text.R3C1.textbgcolor=(white);
text.R3C2.textbgcolor=(white); text.R3C3.textbgcolor=(white); text.R3C4.textbgcolor=(white);
text.R4C1.textbgcolor=(white); text.R4C2.textbgcolor=(white); text.R4C3.textbgcolor=(white);
text.R4C4.textbgcolor=(white);
text.R1C1.item.1=" "; text.R1C2.item.1=" "; text.R1C3.item.1=" "; text.R1C4.item.1=" ";
text.R2C1.item.1=" "; text.R2C2.item.1=" "; text.R2C3.item.1=" "; text.R2C4.item.1=" ";
text.R3C1.item.1=" "; text.R3C2.item.1=" "; text.R3C3.item.1=" "; text.R3C4.item.1=" ";
text.R4C1.item.1=" "; text.R4C2.item.1=" "; text.R4C3.item.1=" "; text.R4C4.item.1=" "}]
/ ontrialend = [if(trial.recall_square.response=="R1C1"){text.R1C1.item.1=values.squarenumber; text.R1C1.textbgcolor=(red)};
if(trial.recall_square.response=="R1C2"){text.R1C2.item.1=values.squarenumber; text.R1C2.textbgcolor=(red)};
if(trial.recall_square.response=="R1C3"){text.R1C3.item.1=values.squarenumber; text.R1C3.textbgcolor=(red)};
if(trial.recall_square.response=="R1C4"){text.R1C4.item.1=values.squarenumber; text.R1C4.textbgcolor=(red)};
if(trial.recall_square.response=="R2C1"){text.R2C1.item.1=values.squarenumber; text.R2C1.textbgcolor=(red)};
if(trial.recall_square.response=="R2C2"){text.R2C2.item.1=values.squarenumber; text.R2C2.textbgcolor=(red)};
if(trial.recall_square.response=="R2C3"){text.R2C3.item.1=values.squarenumber; text.R2C3.textbgcolor=(red)};
if(trial.recall_square.response=="R2C4"){text.R2C4.item.1=values.squarenumber; text.R2C4.textbgcolor=(red)};
if(trial.recall_square.response=="R3C1"){text.R3C1.item.1=values.squarenumber; text.R3C1.textbgcolor=(red)};
if(trial.recall_square.response=="R3C2"){text.R3C2.item.1=values.squarenumber; text.R3C2.textbgcolor=(red)};
if(trial.recall_square.response=="R3C3"){text.R3C3.item.1=values.squarenumber; text.R3C3.textbgcolor=(red)};
if(trial.recall_square.response=="R3C4"){text.R3C4.item.1=values.squarenumber; text.R3C4.textbgcolor=(red)};
if(trial.recall_square.response=="R4C1"){text.R4C1.item.1=values.squarenumber; text.R4C1.textbgcolor=(red)};
if(trial.recall_square.response=="R4C2"){text.R4C2.item.1=values.squarenumber; text.R4C2.textbgcolor=(red)};
if(trial.recall_square.response=="R4C3"){text.R4C3.item.1=values.squarenumber; text.R4C3.textbgcolor=(red)};
if(trial.recall_square.response=="R4C4"){text.R4C4.item.1=values.squarenumber; text.R4C4.textbgcolor=(red)};]
/ ontrialend = [if(trial.recall_square.response=="exit" || trial.recall_square.response=="0"){
text.R1C1.textbgcolor=(white); text.R1C2.textbgcolor=(white); text.R1C3.textbgcolor=(white);
text.R1C4.textbgcolor=(white); text.R2C1.textbgcolor=(white); text.R2C2.textbgcolor=(white);
text.R2C3.textbgcolor=(white); text.R2C4.textbgcolor=(white); text.R3C1.textbgcolor=(white);
text.R3C2.textbgcolor=(white); text.R3C3.textbgcolor=(white); text.R3C4.textbgcolor=(white);
text.R4C1.textbgcolor=(white); text.R4C2.textbgcolor=(white); text.R4C3.textbgcolor=(white);
text.R4C4.textbgcolor=(white);
text.R1C1.item.1=" "; text.R1C2.item.1=" "; text.R1C3.item.1=" "; text.R1C4.item.1=" ";
text.R2C1.item.1=" "; text.R2C2.item.1=" "; text.R2C3.item.1=" "; text.R2C4.item.1=" ";
text.R3C1.item.1=" "; text.R3C2.item.1=" "; text.R3C3.item.1=" "; text.R3C4.item.1=" ";
text.R4C1.item.1=" "; text.R4C2.item.1=" "; text.R4C3.item.1=" "; text.R4C4.item.1=" "}]
/ responsemessage = (clear, clickclear, 150)
/ responsemessage = (exit, clickexit, 150)
/ responsemessage = (_, click_, 150)
/ branch = [if(trial.recall_square.response=="exit" || trial.recall_square.response=="0")trial.square_feedback else trial.recall_square]
/ recorddata = true
/ timeout = 5000
</trial>
Regards,
~Dave