I don't particularly want to respond to this thread, given how the thread starter formats messages and talks in general. However, it's more likely that you have other codes enabled or have done something stupid that caused your save file to corrupt itself.
Edit: I checked the code you pasted and it seems that it's trying to write to an improper offset. Assuming this is PokeGen's fault, it'll be fixed in the next version. I haven't specifically checked the program's code yet. I can imagine that there was some mistake made with the Black/White transition. For now (again, assuming this is PokeGen's fault), just don't use boxes other than 1.
Edit2: I was wrong. The offset is fine. The codes are fine. PokeGen is fine. I don't see how it could be anything other than another code or you doing something else and not having a clue how it would affect anything.