The first line causes an error. I don't know the exact terminology to explain it, but I don't think you can have an 'if' statement first like that outside of the loop in a FFC. Either way, you don't need to worry about setting it for a specific d-map for this. Simply making a FFC that removes, or gives an item if you are on the screen should work just as well. Once Link is given an item, it will stay with him till it is removed by the other script. Just be sure to check the "Run at screen init." flag so it works the second you enter the screen.
If you want a script that sees what map Link is on at all times to determine what items he has, you'd need a global, but that seems overly complex for what you seem to be trying to do here.
Put this on the first screen where Link will have/ need/ get the Red Ring:
ffc script GiveRedRing
{
void run()
{
Link->Item[18]=true;
}
}
Put this on the first screen where you don't want Link to have the Red Ring.
ffc script RemoveRedRing
{
void run()
{
Link->Item[18]=false;
}
}
edit: This will also work with any item, just change the number, should you need something else like this.