Suppose we have an alphabet of size $n$, and a particular set of words we may call "bad words".
We want to count the words of length $k$ satisfying two requirements:
1) they contain $p$ 'bad words';
2) they repeat no letter except the initial letter, which is required to reappear once and only once.
Notice that the second occurrence of the initial letter can be at any point within the word.
If we didn't have the second requirement, we could handle the first one, for instance, with the Goulden-Jackson cluster method.
If we didn't have the first requirement, the answer would be $n! \times (k-1) / (n-k+1)!$ (if I don't err).
The question is how you would handle both requirements simultaneously.
Added Example
Here is an example. Suppose we call 'bad words' all the following strings of two letters: (1,2),(2,3),…,(n−1,n),(n,1). Here I'm calling (i,j) the two-letter string composed by letter $i$ and letter $j$.
For $k = 9$ and $p=3$, a word of the type we are counting is $264591237$. The first requirement is indeed satisfied by this string because it contains $p=3$ bad words: $45$, $12$, and $23$. The second requirement is also satisfied, because the only letter that is repeated is $2$, which is the initial letter, as it should.
A string like $267314589$ is not of the type we are counting because the initial letter is never repeated; a string like $264591232$ is not of those we are counting, because the initial letter appears three times.