Try writing your equation explicitly with a conditional expectation operator:

$$ \mathbb{E}_t f(\alpha_t, \beta_t, s_t, s_{t+1}) = 0$$

Hopefully this clarifies things.  You can take the total derivative as you normally would with any function, however $s_{t+1}$ is a random variable since it is not predetermined.  Just pay attention to the conditional expectation operator and everything will be fine (it's a linear operator).  Ultimately you are considering all cases of $s_{t+1}$ weighted by their probability.