You can't have it run a html anything, you can send data out the serial port to another device that does as you wish (or triggered via rules).
You need to determine the conditions that would generate what you want it to do....whenever XX happens (change state, disarmed, etc).
Based on your initial post the rule would be whenever armed or disarmed and last user was XX. System doesn't care about state of the door but only if a code was used to cause it to change state. Another rule for "no code" would need to be used or disable quick arming.