You are not alone, I have had a support case open since 19th Feb (Case 00112674) relating to the fact that variables are not resolved correctly within custom patch definitions. I discoverd it when I tried to use a variable within a "Replace text in file" action. I suggest opening a support case for this, and reference the above case number.
One thing to consider is that the job may be running as localsystem -- make sure that the variable resolves in a localsystem shell (use something like at 8:56 /interactive cmd on your test workstation to make sure it works).
I just tested by modifying sevich's brokerconfig custom definition, http://community.landesk.com/support/docs/DOC-2397 -- it worked there, using an 8.8 agent.
I think Puercomal has it on the head -- not all system variables exist in all system environments, so you're likely hitting up against that.
I can understand many of the variables missing in SYSTEM's context, but %ProgramFiles% is definitely a variable that exists for all users at all times. Strange. I also played with that BrokerConfig definition and I WAS able to get it working with %regval% but NOT with %ProgramFiles%. I dont know what would be so different here. 8.8 client? Can anything about the client config have any affect on this?
No, but it's entirely possible that the error message is misleading you from the real problem.
Maybe some more detail is in order?