I am trying to construct an explicit path which connects two arbitrary points $a,b \in \mathbb{R}^2\setminus\{0\}$. My idea is to take a ball of radius $\epsilon>0$ around zero, $B := \{(x,y) : |x|,|y| = \epsilon\}$, then construct a line from $a$ to $b$ parameterised by $ta + (1-t)b$, next if the line intersects $B$ at any time, the path will then proceed to follow the boundary of the ball around by the required amount, and then continue to follow the line.
So I tried to define $f:[0,1]\rightarrow \mathbb{R}^2\setminus\{0\}$ by a piecewise definition $$f(t) = \begin{cases} ta + (1-t)b, &\text {if } f(ta+(1-t)b) \cap B = \emptyset\\ \epsilon (\cos(?), \sin(?)), &\text{if ? } \end{cases}$$
But can't figure out what conditions I should place so that I have what I need to connect my points.
The picture looks something like this, thanks.

You're making it harder for yourself than it needs to be by choosing such a relatively complex path. Instead I would do
If the two points $a$ and $b$ are not collinear with $0$ (that is, if their vectors are linearly independent), just interpolate linearly between them.
If they are collinear, then choose a point $c$ outside the line they form with $0$, and go in a straight line from $a$ to $c$ on $t\in[0,\frac12]$ and then down from $c$ to $b$ on $t\in[\frac12,1]$.
Either $(0,1)$ or $(1,0)$ will work as $c$ -- or you can construct it systematically by rotating $a$ by $90^\circ$ around the origin.
Or you could even always use the three-point strategy, and choose $c$ as the first of $(0,1)$, $(1,1)$ and $(1,0)$ that is not collinear with $0$ and one of $a$ and $b$.