The way I would do this would be as follows.
%newTabPos = (%numTabs * (%tabWidth + %spacing) SPC %YPos; //Where %numTabs = current number of tabs, %tabWidth = the width of the button tab, %spacing = the separation of each tab, %YPos = the Y position of all tabs
GUIWindow.add(newButton); //Adds a predefined button named newButton to the GUI's windowCtrl
newButton.position = %newTabPos; //Shifts the button to the correct position
%numTabs++; //Increases %numTabs by 1