Indeed this is the main problem … editing doctype will change base code. Any further update will made it gone.
Actually, core doctypes are not customizable. Check this, there are some clues to workaround it using fixtures … (I didn’t try it recently):
Best approach could be creating a custom-app, using a secondary doctype with the desired custom fields, and linking it to the main one. This way, your changes will be preserved at updating process.