As I understand your question it has two parts. One is how to calculate an approximation of someone's hash rate externally, like from a server or proxy that can see their mining results but not their actual hashing process or hash rate. The other part is how to calculate the probability that a block would be found after a given amount of work, or a given amount of time and hash rate.

I will write the formulas as javascript code, with X to the power of Y written as Math.pow(X, Y). You could run them in your browser by typing them into the address bar like for example javascript:alert((Math.pow(2, 32) * 27939) / 600).

Approximation of hash rate:

With an arbitrary target, count one share at difficulty X the same as X shares at difficulty 1. That's how pools deal with variable difficulty.

hashrate = (Math.pow(2, 32) * shares) / seconds-elapsed

An average of one share (at difficulty 1) is found for every Math.pow(2,32) hashes. This is only an average...