I am posting this to possibly help some people that may find themselves in similar situation.
I used to have a problem with undo command where after i changed a dimension for example and then using undo, it won't undo right away, instead i had to press ctrl+z multiple times ( more than 6 ) to get the value i entered before.
Check video:
Problem with undo command | Search | Autodesk Knowledge Network
The problem was that I had created too many triggers for my personal ilogic codes that were happening to the background. So, i had to undo all those "secret " triggers to get to the dimension value undo.

i had triggers at any model parameter change and any user parameter change, yes it gave me correct data in return but ruined my undo command. So i moved them to trigger at new document, before save and after save.
