I have created this setup, it is giving me the correct answer, however I am interested in a function that does all this calculations and creates a output of mean and standard deviation. The function is has to be able to set the limit which i have named y, and run over a list.
In[302]:= list = RandomReal[{-10, 10}, 20]
Out[302]= {4.48825, 3.31096, -5.1268, -2.11263, 2.04758, 7.41939, \
1.37117, 4.73285, -1.38028, 4.55688, 6.2333, 5.67909, 6.41423, \
0.709616, -3.75265, -3.16793, 2.10447, 0.583272, -0.370173, -8.65539}
In[303]:= pp = Range[Length[list]];
In[304]:= y = 2;
In[305]:= vt = If[(-y > list[[#]] || list[[#]] > y), yes, no] & /@ pp
Out[305]= {yes, yes, yes, yes, yes, yes, no, yes, no, yes, yes, yes, \
yes, no, yes, yes, yes, no, no, yes}
In[306]:= groups = SplitBy[vt, # == yes]
Out[306]= {{yes, yes, yes, yes, yes, yes}, {no}, {yes}, {no}, {yes,
yes, yes, yes}, {no}, {yes, yes, yes}, {no, no}, {yes}}
In[307]:= fpt = DeleteCases[groups, no, {2}]
Out[307]= {{yes, yes, yes, yes, yes, yes}, {}, {yes}, {}, {yes, yes,
yes, yes}, {}, {yes, yes, yes}, {}, {yes}}
In[308]:= rp = Range[Length[fpt]];
In[309]:= bob = Length[fpt[[#]]] & /@ rp;
In[310]:= countLength = DeleteCases[bob, 0];
In[311]:= N[StandardDeviation[countLength]]
Out[311]= 2.12132
In[312]:= N[Mean[countLength]]
Out[312]= 3.`