@Wain
Isn't it dragonwidth + screenwidth, and not dragonwidth*2 + screenwidth?
The dragon has to move a distance equal to its width so that the left end of the dragon reaches the left side of the screen (assuming we're going left to right). Then it has to move a distance equal to the screen width so that the left end of the dragon reaches the right side of the screen - and then we're done.