Oh the hassle... :P
I'll try and write it in here.
Start from scratch.
Make the switch, name it switch, leave it alone.
Make the barrel, name it barrel, leave it alone.
Make an event in the corner.
Variable operations, leave it on the "set" radio button.
Set two different variables - Barrel X and Barrel Y
To do this, go to character and then select the corresponding event that should be named barrel.
Then obviously for X set it to X coordinate
For Y set it to Y coordinate.
Now go out to your map and take note of the map coordinates here yuor switch is.
Go back into the event we are doing and add a con. branch. Check to see if the Barrel x variable = the number of the x coord where the switch is, make sure there is an else statement. Inside the true part of the first branch, do the same for the y coord. Make sure you don't mix these two up!
Then inside this con branch, seeing as all the conditons we need are true (ie the barrel is o nthe switch) turn the door switch on. In all the else statements, turn it off.
Phew, i think thats it