You can emulate this with a shell function, this should work for any POSIX-compliant shell:
tmux() {
if [ "$1" == -z ]; then
shift
command tmux detach 2>/dev/null
command tmux attach "$@" || command tmux new-session "$@"
else
command tmux "$@"
fi
}
tmux() {
if [ "$#" -ge 1 ] && [ "$1" = -z ]; then
shift
command tmux detach 2>/dev/null
command tmux attach "$@" || command tmux new-session "$@"
else
command tmux "$@"
fi
}
Now if you launch it as tmux -z, it should perform the actions you're looking for.