Click the Scripts tab. Then, select your sprite by clicking on its thumbnail:
To make your character say something and then switch to the next scene, add these blocks to your script:
Your script will look something like this: