The base game tesla turret already does that to biters, maybe there's a way to call that same method? Sorry I'd wish to help more but don't know the Factorio mod API well so just spitballing
Out of curiosity, I went looking for it. The item you're talking about is active-defense-equipment. All the effects from that sit inside an "action" AreaTriggerItem, which in turn has a single "action_delivery" InstantTriggerDelivery, which in turn has "target_effects" list consisting of two effects - CreateStickerTriggerEffectItem and PushBackTriggerEffectItem. The first one is responsible for the stun, but it's that second one that's responsible for the pushback.
All of that is to say that it should be possible to reuse this in the Handcannon. I don't have the time to test this, but in theory... The weapon's action_delivery would have to define a "source_effects" array, containing type = "push-back" and distance = 'some integer'. The problem is that this is kind of double-dipping. active-defense-equipment is its own bespoke ActiveDefenseEquipmentPrototype, meaning its interaction with ammo is undefined.
When looking at energy-using turrets, their attack_parameters are defined inside the turret prototype array. When looking at ammo-using turrets, their attack_parameters are defined within the ammo, with the turret prototype array only handling visualisation. Technically, it should be possible to define a delivery_action for both weapon and ammo, but I'm not sure how the game will handle that. Specifically, whether the game with apply both, just one or what. Probably worth experimenting with this as I'm trying to create incendiary rockets of my own, but definitely not trivial.
Well, not trivial to understand. Probably pretty trivial to do - provided it can work without requiring its own clone of tank shell ammo.