Yes, WWE episodes are scripted. WWE is more of entertainment than sport. A storyline is created by writers and played out by the wrestlers.
If the story works well with the crowd, the story is lengthened but if it doesn't, the story is worked on and changed. Many fans of WWE know that the episodes of WWE are script but there still follow up the storyline supporting the hero most of the time.
It should be noted that WWE works with a team of writers who get to decide who becomes a hero and who becomes a villain. This means that there are certain storylines that are played out depending on what the writers think will work with the crowd.
The thing is that people know that the episodes are scripted but they cannot help but root for the hero every single time. It will always depend on how well the wrestlers perform if the storyline will be a hit or not. Those that do not work out are immediately changed and those that work out are usually lengthened.