If you use “Shien’s Spy” on “Silent Swordsman LV5”, it returns to your control during the End Phase as normal.
If you chain “Book of Moon” to “Shien’s Spy” to flip the target face-down, the monster still switches to the opponent and returns in the End Phase as normal.
If a monster switches sides because of “Shien’s Spy” and is then flipped face-down, it still returns in the End Phase as normal.
When a monster returns to the controller during the End Phase for the effect of “Shien’s Spy”, this is not an effect that can be chained to.