There is no simplified description of the Nash equilibrium of this game.
You can compute the best strategy starting from positions where both players are about to win and going backwards from there.
Let $p(Y,O,P)$ the probability that you win if you are at the situation $(Y,O,P)$ and if you make the best choices. The difficulty is that to compute the strategy and probability to win at some situation $(Y,O,P)$, you make your choice depending on the probability $p(O,Y,0)$. So you have a (piecewise affine and contracting) decreasing function $F_{(Y,O,P)}$ such that $p(Y,O,P) = F_{(Y,O,P)}(p(O,Y,0))$, and in particular, you need to find the fixpoint of the composition $F_{(Y,O,0)} \circ F_{(O,Y,0)}$ in order to find the real $p(O,Y,0)$, and deduce everything from there.
After computing this for a 100 points game and some inspecting, there is no function $g(Y,O)$ such that the strategy simplifies to "stop if you accumulated $g(Y,O)$ points or more". For example, at $Y=61,O=62$,you should stop when you have exactly $20$ or $21$ points, and continue otherwise.
If you let $g(Y,O)$ be the smallest number of points $P$ such that you should stop at $(Y,O,P)$, then $g$ does not look very nice at all. It is not monotonous and does strange things, except in the region where you should just keep playing until you lose or win in $1$ move.
Technically speaking, there's only one option, which is to keep stepping forward. Mathematical games, as far as I understand it, don't include not playing as an option. There's no way to optimize or formulate any strategy, because the other player in the game has perfect play as their only move, and always wins with perfect play.
So I guess the optimal strategy is to keep playing until you lose all your money, since it's the only strategy.
I would look at the definition of a game at this Wikipedia article
Best Answer
Your strategy doesn't matter. Consider the following alternative game: You can join whenever you want, but still draw all the balls out. You win if the final two balls are the same color. We observe:
If we join the alternative game at any point, the odds of winning this game are the same as if we had joined the real game (the final two balls have the same distribution as the next two balls, given what has been drawn so far.
If players A and B use the same decision rule when to join, but A joins the real game and B the alternative one, they have the same chance of winning (average the first observation over all times of joining).
Player B's chance of winning in the alternative game does not change at all based on his strategy when to join, so Player A's chance can't change either.
This is a variant on the "Next Card Red" game, which is described in Peter Winkler's "Games People Don't Play "