Nice Mystery Gift script. I'd like to make some comments:
Firstly, what's the reason for the '+ 1 - 1' after each variable assignment? Adding one then subtracting one has no effect.
Secondly, if I remember how Pokémon Essentials works, setting a gift to be shiny won't actually do so. How are you going to fix this?
Nice work otherwise. It's a shame you had to go and steal the trading scripts from Pokémon Raptor - I'm sure that if O.G. Duke or Wichu wanted their scripts to be public, they'd have posted the scripts themselves. I don't think anyone would mind if you decompiled their scripts for educational purposes - I assume your Mystery Gift script is inspired by Raptor's, right?
Anyway, are you going to try your hand at making your own trading script? I bet loads of developers would appreciate it, and you'd get a lot of experience doing so.