If you want the regeneration script to be auto-triggered, best call it in AppOnIdle.
About the var, choose one way from these two:
procedure AddNades(ID: byte);
begin
if ... then GiveBonus(ID, 4);
end;
procedure AppOnIdle(Ticks: integer);
var i: byte;
begin
for i := 1 to 32 do
AddNades(i);
end;
or the same without the parameter, just one AddNades();-call, and the declaration of ID in the var-section of your AddNades-procedure.