The variables are:
s = Sum of the squares of the timing errors of hits/releases that weren't a Miss. (Releases with errors scaled by a constant)
k = Count of hits/releases that weren't a Miss.
m = Count of Misses.
T = Upper limit of the timing window for a 50, in ms.
Case with no MissesSigma is simply
Case with MissesSigma is the positive number that solves the equation:

The equation doesn't have a simple closed form solution, but it can be easily solved numerically with Newton's Method (since the function to find a root for is convex and monotonic).
A first approximation of Sigma (that always is smaller than the real solution) is:

With BS = T/Sigma.
Function to find the root for:

It's derivative:

Note: Because of numerical errors while using double floating-point numbers to calculate the functions, for high values of BS, it's more accurate to use a series expansion near Sigma=0, instead of attempting to calculate their values with the exact formulas.
If BS > 7, then:

If BS >20, then:

The, starting with the initial approximation for sigma, iterate with Newton's Method until F[Sigma] is small:
Sigma[n+1] = Sigma[n] - F[Sigma[n]] / F'[Sigma[n]]
Testing this algorithm, it takes about 0.8ms in average to find an accurate value for Sigma (with an absolute error of 10^(-7)).