Actually, I think you found a bug!
Since I don't really run from the bank with this particular script, I didn't see this.
Goto around like 230 and change this line:
gosub DragItem #FINDID #FINDSTACK C %lootstorebag
to this:
gosub DragItem #FINDID #FINDSTACK C %lootstorebag_bank
Good job finding that.
You should probably verify you have a valid value in the %lootstorebag_bank variable....