This version of Unity is unsupported.

Undo.isProcessing

public static bool isProcessing;

Description

Returns true if the editor is currently processing undo or redo operations, false otherwise.

Note: it is forbidden to call RegisterCreatedObjectUndo while this value is true.