software serial .available() gives inconsistent behavior

Could you post the full program so we can see your declarations and setup().

And does the code execute twice as soon as you press the button, or once when you press and once when you release?

How is the button connected to the Arduino?

All the best

Ray