I like the suggestion presented by Alexey. Still, some additions:
I do not think you can actually block the entry of a number smaller or greater than some other number, because you'll have to deal with an intermediary state. Let me explain. In the basis, you have two states. Eiter the number entered is valid, or it is not. However, there is a third state, and that is if the input may become valid when the user is done editing the contents. For instance, say that your minimal value is 9, and the user enters a 1. Is that invalid? No, it is intermediate, as the user may next enter a 0 and thus have entered 10. The user had to pass though that intermediary state to reach the valid state.
I don't think there is a good way to determine if, as long as the input is numeric, it is not an intermediate state. More so if you take into account that the user can make mistakes entering the data or could be copy/pasting values from a system where the the decimal and thousands separator symbols are different that what you're expecting. Thus, you can't block it and have to allow the user to edit the intermediary value, as blocking would stop the user for actually reaching the valid state.
As for making sure the entered data is valid: simply provide some feedback on the currently entered data, and don't allow going to the next step while the entered data is not valid. Automatically resolving would, I think, be a source of errors. You could offer an easy way to swap the values though, if you think that that will be something that's needed frequently.