Yes, you do lose your genes when you die, but straight after injecting yourself with the genes of your choice, you can use the syringe to get your new blood with the genes inserted, which when centrifuged, you can use to give yourself back all the genes if you die, bypassing a large amount of work.
continuing on another persons post. you can get the keep inventory from an enderman and then get a syringe of blood before death when you get back to your house you can centrifuge it and therefore beat death. you could be mobbed and dying but have enough time to take a syringe.
yeah its really not hard to just backup a vial of blood before you go running off to get yourself killed. theres also the homeostatic tube which works as a bed, and when slept in will restore all the genes you had since you last slept.