Hi Sunil,
Your logic is almost correct. In fact you don't really need the Input Selector as you already receive a 0 or 1 from the Equal-comparison in the String Compare-block. You only need to add a NOT-block to invert the selection. (so a 0 becomes 1 and 1 becomes 0).
The other important thing is that you want to make sure that when the state changes and you want to trigger the other Scene Director, you have to make sure that the other Scene Director is stopped. So if the IN-animation has played and next you want to trigger the OUT-animation, you have to make sure that you stop (or maybe pause works also) the animation.
Because when you send a play command to your Scene Director, it will stay in a play-mode, even if it has reached the end of the animation. So when you then play the other animation, you could get some flashes because both Scene Directors are playing at the same time and perhaps trying to update the Alpha-value of an object (just an example) causing flashes.
That's why on the Visual Logic I have added an OnPlay-command to stop the other Scene Director.

I have also exported this project and I have put on WeTransfer (https://we.tl/t-1bQDi1rann) so you can download it and check it out for yourself.
Best regards,
Kenneth
#XPression