The crux of your question seems to be, "how do you go about getting them"
(the constants $1$ and $\frac 12$).
The short answer is: the choice of constants $1$ or $\frac 12$ is a completely arbitrary choice in many cases; in other cases there are restrictions on what constant you can use, but the choice is still an arbitrary choice within those bounds. There is no formula to "derive" the $1$ or $\frac 12$ exactly, but that's OK, because you don't need a formula.
I've already explained the general idea in a previous answer,
Why do we impose the constraint $\delta\le 1$ when proving the continuity of $x^3$ using the definition of continuity?
That answer talked about a different function than $x^4 - x^2 + 1,$
but the main point is the same: the $1$ comes into play in
$\delta = \min\left\{1, \frac{\epsilon}{168}\right\}$
because your $\delta$-$\epsilon$ assertion must give the desired result
for all positive $\epsilon$,
and a simpler assertion such as $\delta < \frac{\epsilon}{168}$ unfortunately
would not be sufficient for large values of $\epsilon$
(specifically, in this example, any value of $\epsilon$ greater than $168$).
Your second problem is an example of "why $\delta < 1$ is not always helpful"
as explained in my previous answer.
The difficulty is that if $f(x) = \frac{x+4}{x-4},$
the function $f(x)$ is unbounded near $x = 4.$
If you are to find a limit of $f(x)$ at $x = 5,$
the condition $0 < \delta < 1$ tells you only that
$|x - 5| < 1,$ that is, $4 < x < 6,$
and there are values of $x$ in that range (namely, values close to $4$)
that will cause $| f(x) - f(5) |$ to be larger than whatever
value of $\epsilon$ you may be given.
But if you make a stricter condition, such as $0 < \delta < \frac 12,$
then you can avoid the bad behavior of $f(x)$ near $x = 4.$