The GET request that gets sent to the Arduino is different, depending on whether it is an initial request or a submit request. An automatic refresh is just like an initial request.
You should print out the full request, to see the difference(s). One will have ?name=value&name=value type stuff. The other won't.
So, you can distinguish between a status request and a change request. It is only the change requests that you want to count (although I don't think that counting them is the right approach). If you properly act on each change request, opening or closing the door, and you properly read the open and close switches, it is not necessary to count how many times you've been told to open or close the door. You'll know, based on the limit switches, whether the door is open or closed (and based on the last request ) or opening or closing.