When Integrate calculates the definite integral, it has to take a limit for $x\to \infty$. I'm guessing that's where the difference between the two signs in front of a causes trouble. It's not that the limit doesn't exist. It's that the input to Limit may be in a form that is too hard for Mathematica to simplify in the first formulation of the question, before it times out.
We can try to decide if the integral converges or not, by doing the definite integral and investigating the limits of the definite integral separately:
integral = Integrate[ 1 - Cos[8 ArcTan[(Exp[x - a + z] + Exp[-x + z])/(1 - Exp[2 z - a])]], x]; result = Limit[integral /. x -> Log[y], y -> ∞] - integral /. x -> -z
The output is a long and unilluminating expression, but it's obtained without making any assumptions at all, as you can see.
Above, I helped Mathematica do the $x\to\infty$ limit (after the integration) by switching to a new variable $y=e^x$. Because this is a monotonic transformation, the limit is equivalent to $y\to\infty$, and that limit can be done by Mathematica without difficulty.
By default, Integrate doesn't generate conditions, so it wasn't initially obvious that the result you obtained in the second attempt was generally valid. But the approach I chose here seems to confirm that the integral can indeed be done without any assumptions.
This leaves the question why the first attempt in the question failed. The limit of $x\to\infty$, which I avoid by the above substitution, can in fact be done by Mathematica, but it takes quite long. If I ask for
Assuming[{a ∈ Reals, z > 0}, Limit[integral, x -> ∞]] Assuming[{a ∈ Reals, z > 0}, Limit[integral /. a -> -a, x -> ∞]]
both eventually return a result. So the sign in front of a in itself is irrelevant to the ability to get a result, if I split up the calculation as shown. It just seems that the calculation in one case times out if we ask Mathematica to do it in a single command.
GenerateConditions -> True, both expressions indicate that the integraldoes not coverage on {-z, Infinity}$\endgroup$