Rework on undo/redo and block functions: more efficient code to undo/redo block move and mirror operations