MegaEdit has a number of default scripts avaliable - here we go over the setup for using and applying the layer support script.
You are first required to tick the layer support script against the product you with to use it on.
This will then automatically apply a field tag of "layer_N" against any fields you add to your canvas. This was you can set certain fields to be on certain layers based on the tag.
Now that the fields are tagged they will stay in that order, making sure that fields with layer_2 tag are above layer_1 fields etc.