Your scripts look like you're trying to require both a private key and a password.
My bad. That isn't strictly necessary. I just wanted to know if there was a way to make some information public and send the coins to the discoverer.
Even without the race condition issues (you could give it directly to a trusted miner), such transactions have the problem that if anyone guesses it's a password protected output they can try to brute force it. Many users would select weak passwords that were too short to withstand brute forcing and lose their money. It's not a good idea to encourage such usage patterns.
In some scenarios I had in mind, as long as the correct answer is given, it wouldn't be so important to have brute force attacks. The coins would not be supposed to be for someone in particular, but for anyone who could give the answer and made it public. Anyway, to prevent dictionary attacks I thought you could add some salt, like in password checking in computers.
Take for instance a "computational race" similar to mining. You could give a prize to whomever found first a string with a hash between two values (a given header, like in mining). With script, it seems you could do it.
I was also thinking in solutions to problems that are hard to compute, but also easy to check (like NP problems). You could offer a reward for a solution which checks right. You wouldn't mind brute force attacks, in fact you would encourage them.
Anyway, if nonstandard script is used, I guess you need trusted miners anyway. I was just curious if you could do this kind of thing with minimal trust, using the regular network.