No, the Quran says Allah guides who he will and LEADS Astray who he will.
This is about actively guiding and misleading not about knowing what somebody will choose.
And the hadith says Allah WRITES DOWN YOUR DEEDS (including whether or not you will go to heaven) before you are born and then you might be doing the opposite and Allah's writing overtakes you and leads you to where he ordained you should go.
So unfortunately the Allah knows what you will do defence does not work because the Quran is clear Allah DETERMINES what you will do.
And to be clear Allah needs me. Have you not read in the hadith that if I did not sin Allah will destroy me and replace me with somebody that will son and then ask him for mercy? Allah needs me I don't need Allah.
