This will not work using the /correctresponse attribute. It only accepts hardcoded values. To have a dynamically (or randomly) determined correct response, you must use /iscorrectresponse. In a nutshell:
<values>
/ correctkey = 1
</values>
30 = keyboard scan code for "A"
38 = keyboard scan code for "L"
<block myblock>
/ onblockbegin = [values.correctkey = noreplace(30,38)]
/ trials = [1-4 = mytrial]
</block>
<trial mytrial>
...
/ validresponse = (30,38)
/ iscorrectresponse = [trial.mytrial.response == values.correctkey]
</trial>
Re. <values> vs <variables>:
<values> are akin to what you would call global variables in other programming languages.
<variables>, on the other hand define between-subjects conditions by substituting entire *elements* (e.g. <text>, <trial>, <block>) based on the assigned condition / group.
<variables> have some limitations and -- while useful under specific circumstances -- should be avoided in most cases. Use various <expt> elements instead to create between-subjects conditions via their /subjects and /groupassignment attributes.