FreePBX uses the Authenticate application to check PINs. Close to what @PitzKey said but it would look a little more like this
[sub-custom-context]
exten => s,1,Authenticate(/path/to/pass/file,m)
exten => s,n,GoTo(findmefollow,8750,1)
exten => s,n,Return()
Authenticate will look at the file for the password you want to match. The list would contain a list like
accountcode:password
accountcode1:password1
You can store all your passwords there. You could also use the AstDB for this as well.
https://wiki.asterisk.org/wiki/display/AST/Application_Authenticate