Yes, it would certainly be possible to build using <block>-level /timeout attributes along with a bunch of expressions. The exact implementation will depend on the scripts you are using -- and I would thus recommend to study their code extensively prior to embarking on any modifications.
The basic idea goes like this:
<values>
/ tasktimeout = 120000
/ waittimeout = 0
</values>
<expt>
/ blocks = [1=taskblock; 2=waitblock]
</expt>
<block taskblock>
/ onblockend = [values.waittimeout=values.tasktimeout-block.taskblock.elapsedtime]
/ trials = [1-100=tasktrial]
/ timeout = values.tasktimeout
</block>
<block waitblock>
/ skip = [values.waittimeout <= 0]
/ trials = [1=waittrial]
</block>
<trial tasktrial>
/ stimulusframes = [1=tasktext]
/ validresponse = (57)
</trial>
<trial waittrial>
/ stimulusframes = [1=waittext]
/ validresponse = (noresponse)
/ timeout = values.waittimeout
</trial>
<text tasktext>
/ items = ("Press the SPACEBAR as quickly as possible.")
</text>
<text waittext>
/ items = ("Please take a rest for <%values.waittimeout/1000%> seconds.")
</text>