Hello,
You will have to write code in your screen_custom.js file for this.
To read a textfield from a M1 screen
var screencheck=$('#m1-screen-textfield').val();
Then a if statement or even a switch case statement to perform the conditions you need to direct the user to the correct screen.
If you are familiar with JS then it should be pretty simple to implement. Remember that M1 is a gui designer and not a code generator. You will have to code the logic. If you search this site and view some of the examples and explore the _custom.js files for that example you will learn a lot.
Cheers…