Hi Adrian,
You code is strange and incomplete, it's not possible to understand what you want to achieve....
From the syntax point of view, the lookup label have to match definition:
*REC(EXPRESSION = %VALUE% / LOOKUP(TIM_%TIM%) )
But anyway, please open a new discussion and explain your requirements inline with: How To: Ask questions about Script Logic issues
B.R. Vadim