So, the pokemon Data Structure can be found here: bulbapedia.bulbagarden.net/wiki/Pok%C3%A9mon_data_structure_in_Generation_III
If you scroll down, it has an offset towards it. The problem is that the EVs and IVs are encrypted and you need to perform a checksum afterwards that needs to match what the game has, otherwise you get a Bad Egg. Luckily, someone made a routine to decrypt this data:
pokecommunity.com/showthread.php?t=168600
Read through the thread. You'll have to use their decryption routine with a callasm command to load it into RAM, then you can use other routines to manipulate that data and make changes such as EVs and IVs. There's a routine for EVs in the thread, but I didn't find one for IVs. I planned to try my hand at writing one, but I'm not skilled at ASM so I can't possibly give an ETA or any guarantee that I'll finish it. You'll have to either write your own or find one.
After that, you have to use the encryption routine that's also in that first post to store it back in the game in the proper area.
NOTE: The decryption routine only works for the LEAD pokemon. So if you wanted to have the entire team available or a different team slot, you'll have to rewrite the decryption and encryption routines.
You could then just use callasm commands to change EVs and IVs whenever you want. Although I don't know how to do that with items, it's not very difficult to script for NPCs.
The real trouble is Natures. I haven't found any routines that do this yet. If I'm not wrong, you'd have to mess around with the pokemon's personality value, which makes the process a lot more complicated.