Sheikh `Abd Allah al-Dumayjî
The saying of “in shâ’ Allah” (meaning: “if Allah wills” or “God willing”) is intended to tie a forthcoming matter to Allah’s will. In other words, it is an admission that everything happens by the will of Allah. We are commanded never to be certain about future events to the extent that we forget that such events are possible only by Allah’s willing them to be.
Allah says: “Nor say of anything ‘I shall do so and so tomorrow’ without adding: ‘if Allah so wills’.” [Sûrah al-Kahf: 23]
Sometimes the statement “in shâ’ Allah” may be used for the affirmation of something. This is the case with the verse: “Ye shall enter the sacred mosque, if Allah wills.” [Sûrah al-Fath: 27] In this case, entry is a sure thing, since Allah says at the beginning of the verse: ‘Ye shall enter...’.
This usage is also found in the Sunnah where the Prophet (peace be upon him) offered salutations to the denizens of the graveyard, saying: “And we shall follow you, if Allah wills” though death is assured for all of us.
It is also used to express hope. The Prophet (peace be upon him) used to say while visiting the sick: “You are alright; it is a purification for you, if Allah wills.”
As to your question, we would like to start off by saying that you may not do unlawful things and, moreover; it is disrespectful for you to connect such deeds with Allah’s willing them. You may definitely not use this phrase to express hope for such things. This would be even greater in sinfulness.
The only way that using this phrase in such a context would be correct is if you mean by it to say that you could never commit such bad deeds and could never ever fall into apostasy, except of course, if that was the will of Allah.
However, even in this context, it is recommended for you not to speak in this way, and we advise you not to do so. Rather, you should be seeking refuge with Allah from such evil deeds. You should be asking your Lord to save you from them and to protect you in every way.
Source: Islam Today