Let's face it...we ALL script to some extent:
One way that I've seen to help reduce scripting is to join in with it. If a child is scripting a TV show, join in with the script. Then, slowly change it up in a silly way--using the child's name is usually very successful. If you don't fight it, but join it, many times, it will devolve and will only return in high anxiety situations.
I have one girl who LOVED scripting anything with a 'dot.com' after it. Obviously, this does not usually make sense it any conversation. So we began making silly dot coms, like her name or dog's name and adding dot org and dot net. Soon, she was asking for the "dot com game". The rules I had were :
1.) SHE had to start
2.) we couldn't use each other's ideas
3.) and NO repetition.
Soon, she eliminated this form of scripting. OCCASIONALLY, she will ask to play the game, but it never lasts too long.
IF after trying to join in, etc. doesn't eliminate the scripting, it is best to treat it as you would masturbation. They can do it in the privacy of their room, but not in other areas. So, if they begin to script, you say, "Okay, honey--you need to go to your room if you want to script/talk about that".