Yes you can do this but this particular logic would need to be written in a SmartApp that fires a Routine—that changes your mode.
Not sure how the door would be opened without being unlocked (kicked in?) But yes this would also be possible via SmartApps (code).
As you can see the benefit of SmartThings is how customizable it is—if you are developer. If not, there are rules engine SmartApps and services out there. Here are a few: