To compute the directional standard deviation of the ocean waves using ERA5 data, please have a look at the following document (from Jean Bidlot, ECMWF):
directional_width_parameter_in_ECWAM.pdf
Moreover, to complement the mean direction parameters, ERA5 data also provides the wave spectral directional width parameters for the total sea, wind waves and total swell
...