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.
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 and that is why the hash rates displayed at pool web sites are only approximations.
Block solution probability:
The probability of one or more blocks being generated from a given number of shares (proofs of work):
prob = 1 - Math.pow(1 - 1.0 / difficulty, shares)
That's from 0 to 1. Multiply by 100 if you want a percentage.
Let's say the difficulty is 4367876 and someone has been mining with a hashrate of 200 Ghps for 10 minutes. That's 200 * Math.pow(10, 9) hashes per second for 600 seconds, with an average of one share (at difficulty 1) found for every Math.pow(2,32) hashes. This gives us the following:
shares = (200 * Math.pow(10, 9) * 600) / Math.pow(2,32) = 27939
prob = 1 - Math.pow(1 - 1.0 / difficulty, shares) = 1 - Math.pow(1 -
1.0 / 4367876, 27939) = 0.00637...
In other words the chance that someone would make one or more blocks with the given hash rate and difficulty within 10 minutes is about 0.64%
Note: if you see how many shares (proofs of work) they send in, of course you don't first calculate their hash rate only to calculate it back into a number of shares. Just plug it into the formula.