Do you think a con-man would be able to con the All Knowing?
You have a concept of what a Just God would be like - that's why someone repenting at the end of their life after a lifetime of bad deeds comes off to you as unfair - because justice demands they somehow makeup for their misdeeds either through punishment or making amends of some sort.
There are living people who have done bad deeds who feel guilty for what they've done and seek to right their wrongs. For those people - do they not, whether they believe in God or nor, repent first? At some point they face what they've done and turn away from that life and however little and in whatever way they can they begin attempting to live anew - to right their wrongs.
Is it justice if such a person repents and spends a day righting his/her wrongs only to die suddenly and unexpectedly the next day? They repented, yet only had one day to make amends. The repentence was sincere. Does their dieing early have any bearing on the sincerity of their repentence? God will know if someone is insincere.
How long should someone have to be punished in order to make amends for their deeds? I believe an All Knowing Just God will perfectly punish in such a way that perfectly fits the deed and will do it for as long as is needed to correct the behavior - and yes, if the person insists, he'll do it even into an eternity of ages patiently waiting for his Prodigal to come Home.
Just one man's belief of course.