I don't know about MIP bu the LAG function generally does not work as expected inside any "if" type structure as the lagged value(s) come from the last time the "if" was true, not the immediately preceding record. So you can be looking at considerably different values than expected. The typical approach is to unconditionally assign the Lag value to a variable as you have done prior to the condition and then conditionally use those values.
So maybe, and I am guessing here as no experience with MIP, moving the LAG calls to before the "if simulation horizon" would address this. Might require a second set of variables though like:
beginblock main;
L1 = lag1(INT)
L2 = lag2(INT)
L3 = lag3(INT)
if simulationhorizon <= NO then do;
INT_LAG1 = L1;
INT_LAG2 = L2;
INT_LAG3 = L3;
if simulationhorizon = NO then ACCUM_INT = sum(INT, of INT_LAG:);
end;
_value_=1;
endblock;
If you paste code into a text box opened on the forum with either the </> or "running man" icon indentation and such is preserved. The message window will reformat text and sometimes results in code that doesn't run properly when copy/paste to an editor because of inserted or removed characters.