You should generally try to avoid dealing directly with angles and lengths: use vector arithmetic when possible, or matrix transformations describing geometric operations.
In this case, you're really doing is computing a reflection across the line $Y$, right? The matrix that computes this is surely something you could look up, but it's easy enough to compute ourselves: we can (usually) solve for the matrix if we have two equations, and for that we just need to know how it acts on two points.
Since $Y$ is given by the equation $y = ax+b$, we know
- A parallel vector to $Y$ is $(1, a)$
- A perpendicular vector to $Y$ is $(a, -1)$
The matrix that reflects vectors has to send $(1,a)$ to $(1,a)$ and $(a,-1)$ to $-(a,-1)$. We could set up a system of equations and solve, or set up a matrix equation and solve, but here we know the eigenvectors and eigenvalues of the matrix so we can write it as
$ R = \left( \begin{array}{cc} 1 & a \\ a & -1 \end{array} \right) \left( \begin{array}{cc}1 & 0 \\ 0 & -1 \end{array} \right) \left( \begin{array}{cc}1 & a \\ a & -1 \end{array} \right)^{-1} = \frac{1}{a^2 + 1} \left( \begin{array}{cc}1 - a^2 & 2a \\ 2a & a^2 - 1 \end{array} \right) $
So if $I$ is given by the equation $y = a_I x + b_I$, then a parallel vector to it is $(1,a_I)$. Use the matrix to reflect it
$ R \left( \begin{array}{c} 1 \\ a_I \end{array} \right) = \left( \begin{array}{c} s \\ t \end{array} \right) $
Since you already know that the intersection point $(x_P, y_P)$ lies in $O$, its equation is given by $s(y-y_P) = t(x-x_P)$, and you can wrap it up from there.
One nice thing about this is that it works naturally on vectors. This is very useful if, for example, you didn't just have the equation of $I$, but actually had a velocity vector you wanted to reflect. Then, applying the matrix $R$ immediately gives the reflected velocity vector with the same magnitude.