By input states do you mean stuff like knowing whether a key is currently pressed or a mouse button is currently held down? Could you explain what you mean by it gets messy?
I mean segregating mouse actions. So: Drag, Click, etc. Also handling selection events and so on. I've been using love2d, which basically means you have to set up those manually. Then building a state machine in lua gets very messy.