Suppose we are given a dataset with $T$ time periods and $N$ assets or portfolios. We are interested in estimating and testing the CAPM or a multifactor model. Take the CAPM: $$ r^*_{i,t}=\alpha_i+\beta_i \mu^*_{m}+\varepsilon_{i,t} \tag{1} $$ where $r^*_i:=(r_{i,t}-r_{f,t})$ is firm's $i$ excess return and $\mu^*_{m}:=(\mu_{m,t}-r_{f,t})$ is the market's expected excess return (assumed to be constant over time for simplicity). According to the CAPM, $\alpha_i=0$ for each $i$.
We could estimate the model Fama-MacBeth style. That is, we would first obtain estimates of the betas from time series regressions $$ r^*_{i,t}=\alpha_i+\beta_i r^*_{m,t}+\varepsilon_{i,t} \tag{2} $$ for each asset (with $r^*_{m,t}:=(r_{m,t}-r_{f,t})$ where $r_{m,t}$ is the market return) and then estimate the alphas from cross sectional regressions $$ r^*_{i,t}=\alpha_i+\lambda\hat\beta_i+\varepsilon_{i,t} \tag{3} $$ for each time period. Or we could do it using GMM – see my GMM question. (I suppose there are other alternatives, too.)
Now I would like to add idiosyncratic risk as a candidate pricing factor: $$ r^*_{i,t}=\alpha_i+\beta_i \mu^*_{m}+\gamma\sigma_i^2+\varepsilon_{i,t} \tag{4} $$ where $\sigma_i^2$ is the idiosyncratic risk of asset $i$. (This is just an example. I am not saying I think the idiosyncratic risk is priced in reality.)
I think I have an idea about how we could incorporate it Fama-MacBeth style. $\sigma_i^2$ would be estimated alongside $\beta_i$ in the time series regressions $(2)$ (the first step) and then appended to the cross-sectional regressions $(3)$ (the second step) to yield $$ r^*_{i,t}=\alpha_i+\lambda\hat\beta_i+\gamma\hat\sigma_i^2+\varepsilon_{i,t} \tag{3'}. $$ Does that look alright?
Update: The question about GMM estimation has been moved to a separate thread. This is because this thread seems to have gotten off track due to a highly upvoted answer to a slightly different question. While the answer is great and I appreciate it, I am still interested in GMM estimation and testing of the model, hence the split into two separate threads.