After creation of new element it placed at the bottom of the currently selected parent element. If you want change position of the element inside parent element, you can use buttons Move element up and Move element down.
In the element tree view window, select element what you want to move, then press one of two buttons on the control panes as shown below.
You can use a key combination Ctrl + Arrow Up and Ctrl + Arrow Down to move selected element in elements tree instead.
In case of moving element into other card, deck or other parent element, use Ctrl + C and Ctrl + V keys combination to copy and paste element into new location.
In the element tree view window, select element what you want to move, then press Ctrl + C. Select destination parent element and press Ctrl + V. If parent element does not allow inserting of such element, warning dialog will be appear.
Note that all elements inside copying element also inserts into new location.
From other side, you can just select text in code editor window, cut and paste selection of code without code control. Press F9 button to see what is wrong in code after this operation. Occurred errors or warnings are displayed in Information window.