Sigh...
The second thing is actually quite important. If you can walk while having interfaces open, you can open your bank and go pk while constantly withdrawing food. (In real RS, when you walk, all interfaces close.)
The closeInventoryInterface does just that - closes your inventory interface that is currently open, because banking uses a different one. (15, not 149) In order to fix this, you just need to use the SENDInventoryInterface(149) when you close interfaces.