Allow LPM from bootloader section
Why are you setting the lockbits to prohibit LPM of bootloader flash from application flash? This would prevent someone from using a "bootloader identifier" sketch, if they for some reason felt a need to do that, and doesn't seem to serve any useful purpose...
Also, the "unlock bits" stuff can be removed entirely, When you do a chip-erase, they are reset to their default value (which is what you're writing to them with the unlock bits part...), and you can never write the lockbits such that a 0 can be turned into a 1, so that does nothing (my guess is that this is a pointless step inherited from the official cores... which for some reason do this even though there's no reason to. This s applies to all classic AVR hardware packages where a bootloader is in use and where the lockbits are set. Prohibiting application from using SPM on the bootloader area, on the other hand, is definitely a good idea.