It shouldn't matter if code is broken into one two or more blocks.
I would use die() statements to debug what is happenning. It seems like it would work if it worked before. No errors? Does it redirect? Did you update the button on the page by any chance?