I have written some javascript that traverses a folder and checks to see if any of the documents in that folder are locked using .isLocked.
This script does what it should apart from always giving an error "Failed to save content: Transaction silently rolled back because it has been marked as rollback-only"