I'm sure that $2\sum|x_i| \lt \sum|a_i|$ is about best possible. That is certainly true in case $n=2.$ Then there will be two solutions with $|x_1| \le a_2$ and $|x_2|\le a_1$. They are $$x_1a_1+x_2a_2={x_1}’a_1+x_2'a_2=1$$ with $$|x_1|+|x_1'|=a_2$$ and $$|x_2|+|x_2'|=a_2.$$ Since at least one of the $a_i$ is odd, we can't get a better result than $|x_1|+|x_2| =\lfloor \frac{a_1+a_2-1}{2}\rfloor.$

In the two odds case $a_1=2t-1,a_2=2t+1$ one has best choices $x_1'=t+1,x_2'=-t$ and slightly better $x_1=-t,x_2=t-1$ with $|x_1|+|x_2|= \frac{a_1+a_2-2}{2}.$

In the even-odd case $a_1=2t+1,a_2=2$ the choices are $x_1’=-1,x_2’=t+1$ and slightly better $x_1=1,x_2=-t$ with $|x_1|+|x_2|= \frac{a_1+a_2-1}{2}.$

If we say that the $a_i$ are non-negative we can trivially make those examples work for arbitrary $n$ by setting $a_3=a_4=\cdots=a_n=0.$ But you stipulated positive.

It is not immediately clear to me how to generalize the first example.
In the second case we can take $a_1=2t+1$ but $a_2=\cdots=a_n=2$ and have $\sum|x_i| = \frac{(\sum a_i)-(2n-3)}{2}.$ A sharp conjecture is that this is best possible.

**later**

If a quick program I wrote is correct, then the results for $n=3$ are fairly orderly but contain some aspects which are not obvious.
Usually the optimum examples for a given sum $k$ have $a_1=a_2$.The exceptions up to $k=300$ are $k=10,12,18,24$

For an odd sum $k=2t+1$ the unique best thing is $$k,\sum|x_i|,[[a_1,a_2,a_3],[x_1,x_2,x_3]]=2t+1,t-1,[[2,2,2t-3],[2-t,0,1]]$$.

With that convention, here are all the even cases for $10 \le k \le 40$

10, 2, [[2, 3, 5], [-1, 1, 0]], [[3, 3, 4], [-1, 0, 1]]

12, 2, [[2, 3, 7], [-1, 1, 0]], [[3, 4, 5], [0, -1, 1], [-1, 1, 0]]

14, 4, [[3, 3, 8], [3, 0, -1]]

16, 4, [[3, 3, 10], [-3, 0, 1]]

18, 5, [[2, 7, 9], [-2, 2, -1]], [[5, 5, 8], [-3, 0, 2]]

20, 6, [[3, 3, 14], [5, 0, -1]]

22, 7, [[5, 5, 12], [5, 0, -2]]

24, 5, [[2, 9, 13], [-2, 2, -1]], [[5, 7, 12], [3, -2, 0]], [[7, 7, 10], [3, 0, -2]]

26, 8, [[3, 3, 20], [7, 0, -1]], [[7, 7, 12], [-5, 0, 3]]

28, 9, [[5, 5, 18], [-7, 0, 2]]

30, 10, [[7, 7, 16], [7, 0, -3]]

32, 11, [[5, 5, 22], [9, 0, -2]]

34, 11, [[9, 9, 16], [-7, 0, 4]]

36, 9, [[11, 11, 14], [-5, 0, 4]]

38, 13, [[5, 5, 28], [-11, 0, 2]], [[9, 9, 20], [9, 0, -4]]

40, 14, [[7, 7, 26], [-11, 0, 3]]

Here are all the other cases up to $k=300$ with more than one optimal solution. Only $k=24$ has more than two such.

52, 19, [[5, 5, 42], [17, 0, -2]], [[9, 9, 34], [-15, 0, 4]]

68, 26, [[7, 7, 54], [-23, 0, 3]], [[11, 11, 46], [21, 0, -5]]

86, 34, [[7, 7, 72], [31, 0, -3]], [[11, 11, 64], [-29, 0, 5]]

106, 43, [[9, 9, 88], [-39, 0, 4]], [[13, 13, 80], [37, 0, -6]]

128, 53, [[9, 9, 110], [49, 0, -4]], [[13, 13, 102], [-47, 0, 6]]

144, 51, [[31, 31, 82], [-37, 0, 14]], [[35, 37, 72], [34, -1, -16]]

152, 64, [[11, 11, 130], [-59, 0, 5]], [[15, 15, 122], [57, 0, -7]]

178, 76, [[11, 11, 156], [71, 0, -5]], [[15, 15, 148], [-69, 0, 7]]

206, 89, [[13, 13, 180], [-83, 0, 6]], [[17, 17, 172], [81, 0, -8]]

236, 103, [[13, 13, 210], [97, 0, -6]], [[17, 17, 202], [-95, 0, 8]]

268, 118, [[15, 15, 238], [-111, 0, 7]], [[19, 19, 230], [109, 0, -9]]

3more comments