I'm sorry, I don't think I explained repeating scripts very well. In this state all your script does is crash the game. The location where you put the ifflag and the iftrinkets commands has to be the one Viridian steps in. The dialogue has to be in a separate script box unreachable from the player. In the ifflag command, "x" stands for a number. You have to put a number in the place of "x". Where you put "nothing" there has to be a reference to an entirely separate script box. The iftrinkets command has to reference the script box with the dialogue in it. So all three scripts would look like this:
The box Viridian is in:
ifflag(1,nothing)
iftrinkets(0,losedvirdian)
The dialogue script that is out of reach of the player (in this case, losedvirdian):
reply
Gah where am'i?
reply
AND MOST IMPORTANT
sad
reply
Where are my friends?
flag(1,on)
The script called nothing has nothing.
Here's a video that may help you:
https://youtu.be/awumadrkyb8If anyone can explain this better please do.