To put it simply, there isn't one specific place to put field effect stuff.
You have to find the appropriate location for each of the effects you want the field to do and have the Conditional.
e.g.
Here we have the base script for raising just the special defense by one stage.
if $fefieldeffects==3 asks 'If the switch for this field effect, Misty Field, is turned on
ret=attacker.pbPartner.pbCanIncreaseStatStage?(PbStats::SPDEF,1,false) ret, is the value to return after checking the code, the value that is obtained for ret is the 'attacker', which pokemon is doing the attacking on the field? 'pbPartner' find that pokemon's Ally on the field. 'pbCanIncreaseStateStage?' is checking to see if it can actually increase it's stats that much. '(PBStats::SPDEF,X,false)' That's determining which stat, and how many stages. (I'm not entirely sure what false does TBH)
Then you have the else statement which is saying if your conditional is not true, in this case the switch for field effect #3 being active, then this move should function like 'blah', these are the conditions to function at all other times, when that field effect is not on. The only difference being, that the move Aromatic Mist (or any move that increases an Ally's Special Defense, assigned the effect 13A in moves.txt, will function like this.
ON - Increases Ally's SpDef by up to 2 stages
OFF - Increases Ally's SpDef by up to 1 stage.
If you have more questions you're welcome to ask, but I'm probably not the best to explain some of the other things that set that specific thing up.
Originally, within the basescripts that came with Pokemon Essentials it would have just had the increasestatstage by 1 thing, with no if-else statement.