Sonoff mini - II

I greet everyone

Please. How can I set my own Sonoff mini switch to monitor the status of S1 and S2 inputs?

S1 ON S2 + some short time = on
&
S1 OFF S2 + some short time = off

When I manually switch the Sonoff mini switch, its function rotates and I don’t want it. I need to fix this possible error.
This is a Sonoff mini with original firmware.
The ability to enter a switch-on delay time would be suitable for functionality testing.

Thank you