Random light switch behavior
It's probably just a broken switch. My guess would be that the switch contact is worn out to the point that it does not make contact, but jiggling it a bit (by turning off and on again) may solve the problem, at least for a little while. 

Replacing a light switch is a pretty simple matter for a DIYer. I recommend swapping it out and seeing if that solves the problem.