hmm... not really sure - I'd have to run the code prob to test...
it could be something to do with the checking at the beginning... eg: You are testing for the button names to processes... why not change that to use hidden fields...
<input type="hidden" name="todo" value="1">
use that in the first form , then in the second form use value="2"
then in the opening statement, just use those to decide what to do?