Unfortunately this is not very easy to do. So, I first give the function and then I explain the pieces.
The input consists of: function whose argument is to be searched, start and end of definition domain, number of sampling points.
myArg[fun_, start_, end_, steps_ : 100] :=
Module[{eps, f, t, s1, s2, xs, d, x, shift, p, t1, t2},
eps = (end - start)/10^6;
f[x_] := Arg[fun[x]];
xs = Range[start, end, (end - start)/steps];
d = f /@ xs // N;
p = FindPeaks[d][[All, 1]]; p = Select[p, 1 < # < Length[d] &];
p = Quiet[
FindMaximum[f[x], {x, #}, Method -> "PrincipalAxis"][[2, 1,
2]]] & /@ (xs[[#]] & /@ p);
{shift, p} =
If[Length[#] == 0, {{}, {}}, Transpose[#[[1]]]] &[(Reap[
Scan[
(t1 = f[# - eps]; t2 = f[# + eps];
If[
Abs[t1 - t2] > 6.27, If[
t1 < t2, Sow[{-2. Pi, #}], Sow[{2. Pi, #}]]]) &,
p]])[[2]]];
PrependTo[shift, 0];
shift = Accumulate[shift];
t = MapIndexed[{f[x] + shift[[Sequence@#2]], x <= #1} &, p];
t = Map[Flatten, t, 2];
AppendTo[t, {f[x] + shift[[-1]], True}];
Evaluate[Piecewise[t] /. x -> #] &];
We may test this e.g.:
f[x_] = If[x > 4 Pi, Exp[ I x], Exp[-I x]];
f1[x_] = myArg[f, 0, 20][x];
Plot[{Arg[f[x]], f1[x]}, {x, 0, 20}, PlotRange -> All]

Blue is the original Arg and orange myArg
Now the explanation:
First the definition domain of myArg is coarsely sampled and peaks in the argument are searched. Then the peak locations are determined more accurately and a check is made if the argument changes by 2 Pi. This info is used to calculate a shift that needs to be added do Arg to make myArg continuous. Finally an anonymous function is assembled. Here are the details
For convenience eps and f are defined.
Then a bunch of sampling points: xs and d are calculated. These are used for a coarse for maxima of f:
xs = Range[start, end, (end - start)/steps];
d = f /@ xs // N;
p = FindPeaks[d][[All, 1]];
p = Select[p, 1 < # < Length[d] &];
The found coarse maxima are then determined more accurately. We need the method "PrincipalAxis" that does not use derivatives:
p = Quiet[FindMaximum[f[x], {x, #}, Method -> "PrincipalAxis"][[2, 1,
2]]] & /@ (xs[[#]] & /@ p);
Then a check is made if the arguments jumps by 2 Pi and if yes the necessary shifts to make myArg continuous are stored:
{shift, p} = Reap[Scan[(t1 = f[# - eps]; t2 = f[# + eps];
If[Abs[t1 - t2] > 6.27,
If[t1 < t2, Sow[{-2. Pi, #}], Sow[{2. Pi, #}]]]) &, p]][[2,
1]] // Transpose;
PrependTo[shift, 0];
shift = Accumulate[shift];
With this information the body of a piecewise function is created and the last statement creates the function and makes it an anonymous function:
t = MapIndexed[{f[x] + shift[[Sequence@#2]], x <= #1} &, p];
t = Map[Flatten, t, 2];
AppendTo[t, {f[x] + shift[[-1]], True}];
Evaluate[Piecewise[t] /. x -> #] &
t = MapIndexed[{f[x] + shift[[Sequence@#2]], x <= #1} &, p];
t = Map[Flatten, t, 2];
AppendTo[t, {f[x] + shift[[-1]], True}];
Evaluate[Piecewise[t] /. x -> #] &