The example I showed uses the a door contact sensor which is separate from the lock. The problem you can end up with is your door gets left open (my kids seem to find closing doors to be a complex task) and then your lock locks. Not particularly useful. To avoid that I set this up. You could certainly take out the extra sensor piece if you wish and simply lock after a given time frame.
Honestly, if that’s all you want I’d check your Schlage lock documentation. My kwikset lock has an option to autolock after 30s which is far more reliable that ST could ever be. The problem for me is that it was too short an interval and it would lock regardless of if the door was open it closed.