As I explained in my answer to the other question, every sequence of flips is equivalent to a set of coins to flip. Performing two sequences in a row is equivalent to taking the symmetric difference of their sets.
We can divide the coins into three groups of $n$ coins by counting 1,2,3,1,2,3,etc. Flipping all of the coins in one of the groups changes the state of every coin. The only non-empty sets of flips that result in all of the coins in the same state as before are the ones consisting of two of the groups.
Proof: Suppose we have a non-empty set of flips that leaves all the coins the same. It can't possibly contain all the coins (because that changes the state of every coin), so there's at least one coin that isn't flipped. Therefore, there must be a coin that is flipped next to one that isn't.
...XO???...
(X indicates a coin to flip, and O is a coin not to flip.) That coin must be switched back, so we have to flip the next coin.
...XOX??...
This coin also has to be switched back, so the next one also has to be flipped:
...XOXX?...
That coin is switched twice already, so the next one can't be flipped:
...XOXXO...
This pattern must repeat every three coins, so it includes all the coins from two groups and no coins from the last group.
If two different sets of flips result in the same position, then their symmetric difference must leave the coins the same. Therefore, the symmetric difference is all the coins from two groups. The converse is also true: if the symmetric difference of the two sets leaves the coins the same, the sets must lead to the same position.
This means that for every set of flips, there are exactly three others equivalent to it: the symmetric difference with groups 1 and 2, the symmetric difference with groups 1 and 3, and the symmetric difference with groups 2 and 3. If the original set contains $a$ coins from group 1, $b$ from group 2, and $c$ from group 3, then the equivalent sets contain $(n-a)+(n-b)+c$ coins, $(n-a)+b+(n-c)$ coins, and $a+(n-b)+(n-c)$ coins, respectively.
Suppose that the original set represents the shortest way to solve the position. Then these three expressions must all be greater than or equal to $a+b+c$. This is equivalent to:
$a+b\le n\\a+c\le n\\b+c\le n$
We can sum these inequalities and divide by 2 to get $a+b+c\le\frac{3n}{2}$.
For even $n$, we can have $a+b+c=\frac{3n}{2}$ by choosing $a=b=c=\frac{n}{2}$. One possible set with these values is $\frac{3n}{2}$ consecutive coins. This corresponds to the position with $\frac{3n-4}{2}$ tails, one heads, one tails, $\frac{3n-4}{2}$ heads, one tails, and one heads. This position cannot be solved with fewer than $\boxed{\frac{3n}{2}}$ flips.
For odd $n$, we can have $a+b+c=\frac{3n-1}{2}$ by choosing $a=\frac{n+1}{2}$ and $b=c=\frac{n-1}{2}$. One possible set with these values is $\frac{3n-1}{2}$ consecutive coins. This corresponds to the position with $\frac{3n-3}{2}$ tails, one heads, one tails, $\frac{3n-5}{2}$ heads, one tails, and one heads. This position cannot be solved with fewer than $\boxed{\frac{3n-1}{2}}$ flips.