If “Puppet King” is Summoned by its own effect, and is then flipped face-down or leaves the field temporarily and returns, its effect resets. It is no longer considered Special Summoned by its own effect, and will not destroy itself during the End Phase.
If a card like “Sangan” adds a Monster Card to your opponent’s hand, and their Deck is then shuffled, the last action that occurred was that a Monster Card was added to their hand. So you can activate “Puppet King” and Special Summon it. (The end of “Sangan”’s effect is when the monster is added to the hand.)
If you Special Summon “Puppet King” during your turn, it is destroyed during the End Phase of your following turn, not the turn it was Special Summoned.
The OCG text specifies that you can only Special Summon "Puppet King" when your opponent adds a Monster Card from his Deck to his hand.