In my SMN lua I had to make some exceptional rules so that the regular gearswap "aftercast" doesn't get executed at all when successfully using a Blood Pact JA.
I definitely had similar issues when developing my SMN Lua, it requires some unique behavior compared to other Luas if you want it working correctly. There are a number of ways to solve it, mine has something in aftercast() which aborts processing aftercast if pet_midaction() returns true. That way if your client receives the message about pet readying BP before Gearswap has the chance to go into aftercast, it doesn't even try.
However, if you have a lot of lag or unstable connection, even that doesn't always work. That's why I added a lag mode to mine which sounds like it's somewhat similar to your approach. Instead of waiting for server packets, it just waits half a second and then goes into pet_midcast gear.
This approach is rock solid for me, it always lands in the right set. I've never had to use the lag mode at all, but I guess I'm blessed with a reliable connection.
Edit: By the way this approach also works in precast & midcast to prevent other actions from taking you out of pet_midcast gear before the BP lands. For example if you start casting a spell or hit Assault right after your BP, before it goes off, you don't want it doing swaps for those actions. You want it to stay in pet_midcast even if it results in a gimpy spell cast with no fast cast.
Job abilities and weapon skills don't have a midcast just fyi. It's precast and aftercast
It's actually precast that JA/WS don't have. They have a midcast and aftercast.
I know logically what you said makes more sense, but in practice, there's no difference between the two because nothing happens during precast. It's only midcast where things start to matter.
My SMN Lua swaps BP recast gear in the midcast, not the precast. Works fine.