Dear professor, how to compute this welfare function. I know that I can find X_t^2 in oo_var but how to compute X_{t-1}^2 or interaction term X_t X_{t-1}?

It seems you are computing conditional welfare. In that case `oo_.var`

will not help. But you should be able to express the welfare function recursively and enter it into the model-block.