It should be fine, since you aren't actually modifying the Pokémon, but be careful what code you use - one I found just actually turned all balls into Master Balls, so I had to redo everything again with the proper balls. You could always just play around with save states until it succeeds, that's what I usually do.