I am trying to replicate the results of the paper " The effects of monetary policy news and surprises " by Milani and Treadwell (2012) JMCB

I have written the codes for this paper which are attached below.

However, when I compare my IRFs with those found in the original paper I get different results for the impact effect of a surprise monetary policy shock, i.e. instead of declining on impact, output gap increases. Any thoughts?

There are 2 mistakes in the first equation if I compare your code with the equation (1) of the published Milani et Treadwell (2012) (equation 2.1 of your attached file):
First:

It should be “-sigma…” or “-tilda” in the equation.

Second, “epsilon” and “theta” seem to be reversed (or x(-1) and x(+1) in equation 1).

I hope it will help and I let you check if there are some other mistakes…

I did not check everything but there is at least one similar mistake in your second equation (your delta is for pi(+1) not pi(-1)).
You should check equation by equation, I believe that it is part of learning