/etc/default/grub - This file contains the Grub menu settings that are read by the Grub scripts and written into grub.cfg. It is the customization part of the Grub, similar to the old menu.lst, except the actual boot entries.
This means that if you want to change the Grub menu, you will have to edit existing scripts or create new ones, then update the menu.
/etc/grub.d/40_custom - is a file specifically for making manual Grub entries.
Follow your instructions above opening /etc/default/grub or /etc/grub.d/40_custom instead.
Add your script and save.
run update-grub afterwards to update the config.
However, there might be a problem where this could fail.
The line command you are sending to the generic kernel (ata_generic.all_generic_ide=1) is telling the kernel at boot, to flip an internal toggle on. The instructions given assume the kernel is compiled with the switch, to turn on the IDE. I haven't done any scripts in the area of sending commands to the kernel but you should find many examples;
https://help.ubuntu.com/community/Grub2/CustomMenus
While editing the grub as I have described above should be safe, keep a live CD or bootable USB handy in the event you need to change your edits.
It looks like you're new here. If you want to get involved, click one of these buttons!