My modification is indeed not a fix but a hack to make it work like you want. If it was a fix I would have told you that we would include it in next versions which was not the case.
What you're missing is that the after_payment function needs to work for all the possible combinations of checkout workflows and all the possible ways you can configure the options of the checkout. You can't just remove a check like that as it would then not work properly for 30% of cases. So no, just removing $old_payment_method!=$payment is not a viable solution.
You said
It is obvious that the second problem cannot be reproduced, because it occurs only when payment/delivery method selection is before registration. I had to move it after registration to work around the problem.
but no, I actually tried with the payment and shipping selection before the registration step and didn't had the issue. Just to make sure, I wanted to try again today but I can see that you changed your checkout workflow back and I can't access your backend to change it again, so I can't test.