[Having looked into this more carefully, I've discovered that my answer is wrong. This is still an open problem, but bounds are given at http://oeis.org/A062714 . I will leave this answer up as a cautionary tale against being hasty.]
Unlike the other question you linked that only permits overlap, which is still an open question, I believe this one has a simple closed answer. Your example of permutations on $123$ is on the right track.
First, let me define an inversion of a permutation: From Wolfram, A pair of elements $(p_i,p_j)$ is called an inversion in a permutation $p$ if $i<j$ and $p_i>p_j$.
Call an inversion adjacent if $j = i + 1$ (that is, two elements are right next to each other, and the first one is greater). We will construct $S$ and show that how soon a permutation appears in $S$ depends on the number of adjacent inversions it has.
We can begin constructing $S$ by listing the elements of the sequence $a_1, a_2, a_3,...,a_n$ in order. (Let's say WLOG that every $a_i$ is the integer $i$, so this sequence is just $1 \ldots n$) The order at the beginning doesn't matter, but we know that there's no use in repeating elements so early, because these are just the beginnings of all possible permutations.
After that, the best thing to do is repeat the sequence $1 \ldots n$ another $n-2$ times, and append $1$ to the end. The reason for this is that when constructing permutations from $S$, we can pick the elements from from the first instance of $1 \ldots n$ until we hit an adjacent inversion. Then we must continue with the next instance of $1 \ldots n$. The only permutation to have $n-1$ adjacent inversions is the reverse permutation. Every other permutation has less. So it's sufficient to construct $S$ this way.
To prove that this is the shortest possible $S$, observe that if there are $j$ adjacent inversions occurring in a permutation before a given element (including an adjacent inversion in which it comes last), that element will be "skipped" $j$ times in our $S$, so we require that element to be in $S$ $j+1$ times. $1$ can have $n-1$ adjacent inversions before it (in the reverse permutation) and every other element can have $n-2$ adjacent inversions before it (by putting it at the end, and writing everything else in reverse order).
Thus $S$ has length $n^2 - n + 1$.