See if this can give you some ideas. You definitely need to finetune the edge cases for the desired operation.
As mentioned on the front panel, a multicolumn listbox is a poor way to enter numerics. I would implement a "sequence editor" where e.g. double-clicking a row would popup a dialog. Start reading here for some ideas....