Initial thoughts on this are that it's nontrivial.
The current implementation simply adjusts the optree of an OP_SASSIGN to insert the internal custom op called pp_startdyn just after the LHS has been fetched as an SV, before it is assigned to. That simply saves the value, allowing it to be restored later. But by this time we've forgotten if it was an element of a hash and if so whether the element existed before we started.
In perl core's case of `local $hash{key} = ...` the local'isation part is performed by pp_helem itself in the presence of the OPpLVAL_INTRO flag so it can do something special.
A fix for this issue would have to take place at or around the time of the pp_helem op that forms the LHS of the assignment so it can know of the presence or absence of the key beforehand.
--
Paul Evans