Changing the order of the menu is usually not a requirement,
If you do want to go there, you'd have to re-order the scripts in /etc/grub.d/
The placement of the menu items in the grub.cfg menu is determined by the order in which the files in this directory are run. Files with a leading numeral are executed first, beginning with the lowest number. 10_linux is run before 20_memtest, which would run before 40_custom. If files with alphabetic names exist, they are run after the numerically-named files.
Once you do these changes, executing "sudo update-grub" will re-generate your menu.
A 'dirtier' way would be to directly 'play' with the 'menuentry' items of /boot/grub/grub.cfg file.
This will give you full control on the order (re-ordering scripts will still force an order on entries generated within each script), but note that, these changes will be wiped off as soon as an update-grub happens again -- like, when your kernel updates. You will have to re-do the ordering in grub.cfg again after that.
IMHO, its not really worth messing with the menu at this 'dirtier' level.
You should find the script re-numbering sufficient for your purposes.