I guess it is implemented by macro already, but it is disabled now. Maybe the implementation has performance problem.
Lua is probably
luamacro plugin. The undo last closed script is an example script for luamacro with kmplus addon. But this has little problem about an incompatibility with 1.1.
Thanks.