I think there might be an easier way to do this. It will sound a
little backwards but it will be less work on the system.
In the dodge feat, in the use script.
Choose a creature from the current group, and set the name in a
customvariable on CR (The creature with the dodge feat).
Then in the attack script, set the last attacked creature to
targetCR. Check Target CR to see if it has the dodge feat. If so,
check the variable that has the name of the dodge opponent and
compare it to
cr.name.
if true use
lastdamage.ac=lastdamage.ac-1 (do same for crit AC).
Pop a note that says opponent has dodge feat and get +1 ac. You are
effectively decreasing the AC hit instead of added to the target AC
for that one attack, but you get the same result. You also don;t
have to worry about any special scripts running all the time. This
will only be called when attacking and the opponent has the dodge
feat. Then only when there is a name m atch. This keeps your
processing time down.
If you like this idea and need help with the actual script, let me
know, I can put it together as I use the same script for the defence
bonus for paladin smite ability for pathifinder. (you choose a
target and your AC increases vs that target)