Checking for info can be done by using
if info==0;
A=oo_.dr.ghx;
E=oo_.dr.ghu;
nvar=size(oo_.dr.order_var);
D=[zeros(nvar,oo_.dr.nstatic) A(:,1:oo_.dr.npred) zeros(nvar,oo_.dr.nfwrd)];
else
whatever you want to filter out this case
end;
Note that info is the second output argument of resol, which you are currently suppressing.
The set_param_value command takes as inputs first the Dynare name of the parameter and then the value:
set_param_value('coef',coef(i))
thus sets the parameter named coef to the value stored in coef(i). If you want to set more parameters in a loop, you can use a cell array with the parameter names and the eval-command, see [DSGE multiple shocks, subfig for each shock/variable?!)
Finally, note that the oo_.exo_simul used in the simult_-command was wrong as detailed in the original post.