I'm not quite sure what the code is supposed to be as add_out appears twice as a subroutine (I think the second one is supposed to be sub_out) but correcting that, adding an endif and thinking through the logic of the code where a variable increments and then is reset at a certain value I think this ends up simpler:
change:
pause 10
if pin2=2 then change
low out
if b5<3 then
b5=b5+1
else
b5=1
endif
goto seq_1
Just note that if b5 starts at 0 then whatever b5 is controlling will run 3 times on the first loop and then will run 2 times on loops thereafter if it is reset to 1.