I think your book is right in theory, but wrong in practice.
First, note that we don't usually use the modal will in conditionals: we don't say If
it will rain, then ...
We can do so when it has the meaning of "be willing to". So we can say If he will go, then...; but this has a different meaning from If he goes, then .... It suggests that there is something about his willingness to go that is in doubt: perhaps it is a difficult journey, or we know he is busy.
In the same way that we can make If he goes into an irrealis (counter-factual) conditional by putting the verb in the past, If he went, we could in theory put that modal in the past for the irrealis, so If he would go meaning If he was willing to go; but in practice, that use is not very common. (Some people say If he would go to mean if he went, but that is different).
So, in principle, from what your book says If you will do me this favour is realis, and must be followed by a non-past I will be grateful, and If you would do me this favour is irrealis, and must be followed by a "conditional" (future in the past) I would be grateful. That is where the book's argument comes from.
Where this falls down in practice is that If you will and If you would are actually used as progressively more tentative (and so, more polite) ways of requesting something, so I don't believe that the claim the book makes holds up. The difference in the second clause (will or would) is about realis or not, i.e. how likely the other person is to agree to do the favour. But the difference in the first part is in practice more about how tentative and deferent the speaker is being in requesting, and not correlated with being realis or not.