maybe a very small amount would be extracted out of the scalp with shampoo, but I think minoxidil is not that soluble in water, so it should not be an issue. The main factor is that before 4 hours and especially before 2 hours, your scalp is still absorbing minoxidil off the surface of the skin, through the pores. If you wash it off, you stop absorption.
Since 2% minoxidil works, so would getting a little less than the max dose with 5%. leaving in on 4 hours just gives you the most for your money, though you get most of that in just 2 hours. 2 hours of 5% is definitely much better than 4 hours of 2%. There could be a time release factor, but I think that unlike finasteride which bonds to serum proteins, minoxidil goes into blood vessel walls, so it should stay there a while even if you don't have more on the surface. Obviously it must leave the vessels too, or degrade, so leaving it on your scalp does help with the time release. But I don't think you need to leave it on that long unless you just want the most for your money.