Depending on the size of the dog, it’s probably more reliable to use a pressure mat sensor underneath the crate that would be able to tell if the dog was in the crate or not.
If you’re saying that you want to just catch yourself having actually closed the crate door or not, it’s not impossible, but it’s going to be tricky because of the amount of metal involved in most crates. Contact sensors use magnets and overtime the metal itself can become magnetized, which throws off the sensor. People often have problems with these with metal gates, for example.
Anyway, in either case it would be pretty easy to do what you want from the arm/disarm standpoint. You would set up a virtual presence sensor for the dog which would say that the dog was “away” when in the crate. Then whatever you have set up to arm should only run when everyone is away. That way you don’t have to worry about the timing for getting out the door. The dog will count as away as soon as they are in the crate, but the people in the family will still look like they’re home until they have actually left the house.