If there are four states:A,B,C,D. Probability of moving to the left is b and prob of moving to the right is a. If starting at state B, what is probability of arriving at state D? The hit says to introduce the probability of moving from C and ended in state A.
Sorry, I forget to say that once arrives at A or D, the whole process end. So starting from B, it can not move to left if the destination is D.
I am assuming that your states A,B,C and D are lined up in the order I have written these letters.
Note:
I am changing my answer based on the edit you have made to your actual problem.
Now to start at B and end up at D suppose we do it in $N$ moves. The first move has to be right and the last move (the $N^{\text{th}}$ move) has to be a right move as well. Thus $N$ must be even.
Moreover the moves have to be as follows: for $N=2$, the moves will be RR for $N=4$, the moves will be RLRR for $N=6$, the moves will be RLRLRR
So you see the pattern. The probability will be $a^{\frac{N+2}{2}}b^{\frac{N-2}{2}}$. Now you can sum it over all even $N's$.