It is a little known fact that most full service airlines will refund your ticket if you can prove that you were denied a visa, and you do not need to buy a refundable ticket to rely on this. The only exception I know of is Saudia (SV), which explicitly does not allow this. (Probably because obtain Saudi visas is not easy.)
You should certainly check, and it may be buried deep in the terms and conditions, but if such a provision applies then there is no harm in buying your ticket as normal in advance.
Your alternative is to buy a fully flexible completely refundable ticket. Once immigration issue your visa, cancel it for a refund and buy the cheapest ticket available.