When can we have will in if clause?

I was taught that we can use will in if clause in two cases:

1. In very formal situation when we want to talk politely.

Ex. If you will wait here, I will call the doctor.

2. When the result of main clause is in the if clause.

Ex. Open the window, if it will help you to sleep

I wonder if there are other situations that we can use this structure. I would be grateful if you could exlain with examples.

Sometimes an if-clause doesn't convey the meaning of condition, e.g. He doesn't know if he will have enough time (if = whether). Then, I think, "will" is OK.
As noted above, will can also be used in an if-clause if the if-clause is an indirect (embedded) question.

I don't know if he will agree to our plan.

Teachers: We supply a list of EFL job vacancies
Thank you very much for your answers.