ignore a BoolProperty from Undo?
if i wisely use an operator that dont have 'UNDO' in its bl_option it can work easely.


class SCATTER_OT_panel_toggle(bpy.types.Operator):
    bl_idname      = "scatter.test"
    bl_label       = ""
    bl_description = ""

    pref : bpy.props.StringProperty()
    def execute(self, context):
        pref=self.pref

        addon_prefs = bpy.context.preferences.addons[__name__].preferences

        if eval("addon_prefs."+pref)== True:
            exec("addon_prefs."+pref +"= False")
        else:
            exec("addon_prefs."+pref +"= True")
        return {'FINISHED'}


example in code ui


        row.operator(SCATTER_OT_panel_toggle.bl_idname,text=na,emboss=False,icon=ixon).pref = "scatter_radar_is_open"