Measuring 24V AC input state with microcontroller
There is nothing intrinsically wrong with your idea. It can be made to work as long as you are conscious of your design decisions (e.g, reaction time and need for isolation). However, given that you are considering isolation, which adds a relatively large transformer into the mix...

You should consider just using an optoisolator driven with a resistor and perhaps a protection diode or a full bridge around it. The output transistor would be directly driven at line frequency and its signal can be processed in either analog or digital form.