Right, first off the LocalVar needs to equal 0 for Izanagi to use Lv5 Death as his final attack. His AI adds 1 to this value each time he uses Tsu or Yume. Then he'll use Kyu, and the AI is supposed to randomly detract 1 or 2 from the LocalVar: 0000 (50% chance of it becoming 0 or 1). It needs to be sitting at 0 when you land the finishing attack so only try to kill him after he's used Kyu (if you kill him after he's used either Tsu or Yume then it's guaranteed that LocalVar:0000 will be either 1 or 2, rather than 0, and you won't see Lv5 Death).
But, I've not fought Izanagi that I can remember so I gotta ask: does he stop attacking after using Kyu or does he do anything else unusual? I've had trouble getting monster AI to subtract values and to my knowledge the game doesn't naturally use subtraction commands in a default game (it instead pushes a new value into variables in most cases). If Izanagi stops attacking or starts using the same move over and over then there might be an issue with the AI that'll prevent you from getting LV5 Death from him (outside of killing him before he has a turn). If he's attacking normally, using a mixture of moves, then his AI is probably okay.
Now for scripting-
I've only a working knowledge of AI (I know how to get things to work but not necessarily how or why they work). From what I know, Random MOD (#) makes the game generate a number based on the one specified. So Random MOD (5) will have the game generate 0-5 as a number (so six possibilities in all); this'll then direct the AI to the correct 'chain'. The (Not) thingie in there though changes how it works slightly. The number has to be the same as the number of options (it perhaps eliminates 0 from the generated numbers) and it'll choose one or the other; a 50% chance in this case.
LocalVar itself seems to be a set of temporary variables that the game uses to store numbers that the game can use to direct monster AI to particular attacks and code. In some cases though they get used to store target information, enemy/character ID, animations, moves, and other information. They're quite versatile, and they go in 20's for some reason, so LocalVar:0000, then LocalVar:0020, 0040, etc. rather than LocalVar:0000, 0001, etc.
Someone with more experience can definitely explain it better, though.