I made one assuming you have multiple passwords stored
passtest$=prompt()
until(found!)
{
local(x!,0)
//added "!found!" jic you had multiple if statements
if(passvar[x!]$ == passtest$ && !found!)
{
//do success stuff here
found!=1 //or you can have found!++
}
x!++
}
There may need to be some tweaking but the gist is there.