Something like a mercury switch could work for this project. Having a switch on each side of the level feeding an AND gate would produce a level result. You could then extend the level horizontally and place the switches appropriately to set the sensitivity. I imagine this working very similar to a classic bubble level. You could also make due with one mercury switch as liquids will always drain to level.