How about, writing a temporary gcode file, each line where it has been executed would be written the the temporary gcode file, but I'm concerned about the impact on performance later on.
And upon power resume or the power has recovered, the first thing to do is to check this file's final line, then compare with the original complete gcode and start midway of the complete gcode, use that as a pointer or reference to resume the print job.
Upon completing the print job, the temporary file would be deleted
Still, I'm wondering if this will really going to make a huge impact on the printer's performance, furthermore the z axis accuracy and pla would work best with this because using heated bed would give varied z height each print (I think).
Also I think most reprap firmware programmer already thought of this idea or method but proven to be somewhat "not relevant" or something due to several factors