Basically a state is present when an item is not on process of transition. In a state an item has certain properties, variables, is of a certain base-type... all that combined describes one state.
If you aren't scared away yet, and if you are prepared to stick for some time to an ambitious and probably longer coding project, send me a PM.
DISCLAIMER: This is something that IS heavy duty coding work. Not for the faint of heart or beginners.
It might even be that we will discover somewhere in the middle that the projects goal isn't even achievable. I think it is, and our preliminary research doesn't tell us different.