We have $5$ unique digits. For the sake of simplicity let's say that these are $0$, $1$, $2$, $3$ and $4$.
We want to find the number of such sequences built using these numbers that:
- Two adjacent elements cannot be identical
- Each digit must be used exactly 2 times
For example, this sequence meets our criteria: $0102314243$
I have been thinking about the way of solving this and I have reached the conclusion that this algorithm is quite reasonable
- Calculate the number of all possible $10$-length sequences built with $5$ numbers: $5^{10}$
- Subtract sequences in which one digit appears only once: $5 \cdot 10 \cdot 4^9$
- Subtract sequences in which one digit appears three times: $5 \cdot {10 \choose 3} \cdot 4^7$
- Subtract sequences in which one digit appears four times: $5 \cdot {10 \choose 4} \cdot 4^6$ You see where it is going.
- ... in which one digit appears 10 times: $10$
Now, we have excluded some sequences more than once, and so we need to compensate for this. - Add sequences in which one digit appears only once and one appears three times
- ... in which one appears nine times and one appears only once
Now, we will get the number of $10$ digits sequences in which all digits five digits were used exactly twice. Now, we need to exclude those in which two adjacent elements are identical. There are $9$ choices of two adjacent positions. We repeat the procedure
- Exclude sequences in which the first and the second elements are identical
- ... in which the ninth and the tenth elements are identical
- Add sequences in which the first and the second elements are identical AND the third and the fourth elements are identical
- ... in which the 1st, 2nd and 3rd, 4th, and 5th, 6th, and 7th, 8th and 9th, 10th elements are identical
This way, we should get our desired answer.
Do you think that this method can work? Are there simpler ways of tackling this problem?

The following approach avoids the inclusion/exclusion process suggested in a comment. We begin by counting the number of admissible partitions of the set $[1..10]$ of sites into five unlabeled pairs.
Separate $[1..10]$ into the blocks $[1..5]$ and $[6..10]$. A pair is split if its members are not in the same block. There are $1$, $3$, or $5$ split pairs.
If there is $1$ split pair each of the two blocks contains two full pairs. The two pairs in block $[1..5]$ can be one of $$(53)\bigl(4(1\vee2)\bigr),\quad (52)\bigl(1(3\vee4)\bigr),\quad (51)(24),\quad (42)(31)\ ,$$ makes $6$ in all. These can be freely combined with the $6$ such choices for the block $[6..10]$, except that $(42)(31)$ cannot be combined with $(79)(8\>10)$. It follows that there are $35$ partitions with $1$ split pair.
If there are $3$ split pairs each of the two blocks contains one full pair. The pair in block $[1..5]$ can be one of $$\bigl(5(3\vee2\vee1)\bigr), \quad\bigl(4(2\vee1)\bigr),\quad(3,1)\ .$$ These $6$ choices can be freely combined with the $6$ such choices for the block $[6..10]$, and then the three split pairs can be paired in $3!=6$ ways, with the following exception: If $5$ and $6$ do not occur in the choices of the nonsplit pairs there are only $4$ admissible pairings of the split pairs. It follows that there are $6\cdot6\cdot 6-3\cdot3\cdot2=198$ partitions with $3$ split pairs.
If there are $5$ split pairs we can pair the sites in block $[6..10]$ in $4\cdot4!=96$ ways with the sites in block $[1..5]$.
It follows that there are $35+198+96=329$ admissible pairings of the ten sites. Multiply this with $5!$ to obtain the final number $39\,480$ of admissible sequences of length $10$.
Note that the number of such pairings of $[2n]$ is dealt with in MSE question The number of sequences of length $2n$ that can be formed with digits from set $A={1,2, ... ,n}$ and..., where one may also find the above $a_5=329$.