To limit the number of added spaces, you can check the position of the first digit of the last group (you can also choose the last digit). Then all you have to do is to describe the different separators the way you want.
~[(\d](?:\b\d{3}\)(?=.{3,5}\W\b) {0,2}\d{3}|\B\d{2}(?=.{4,6}\W\b)(?:- ?| -? ?)\d{3})(?:- ?| -? ?)\d{4}\b~
demo
The same pattern in more readable:
~
[(\d] # first character discrimination technic (avoid the cost of an alternation
# at the start of the pattern)
(?: # with brackets
\b \d{3} \)
(?= .{3,5} \W \b )
\g<spb> \d{3}
| # without brackets
\B \d{2} # you can also replace \B with (?<=\b\d) to check the word-boundary
(?= .{4,6} \W \b )
\g<sp> \d{3}
)
\g<sp> \d{4} \b
# subpattern definitions:
(?<spb> [ ]{0,2} ){0} # separator after bracket
(?<sp> - [ ]? | [ ] -? [ ]? ){0} # other separators
~x
demo
Feel free to change -
to [.-]
or to define your own allowed separators. Don't forget in this case to change also the quantifiers in the lookaheads. Also, if you want to allow the second separator to be empty, check the boundary after the last digit instead of the boundary before first digit of the last group.