The first question I would have here is whether the first implementation does what you want.
The reason I am asking is that while this resembles what people did, I have the impression that this method fell out of favour and people started to use variational dropout (Gal and Ghamarani) where the dropout mask is sampled once for batch x features and multiplied to all timesteps and which has an interpretation as dropping values from the weights.
If you just want the style implemented by the first example, you could just apply dropout to the packed_seq.values and construct a new PackedSequence with that and all other items taken from the original packed sequence (yeah, it say you should not construct it, but well…).
If that is not what you want, probably sampling batch x features and then having a for loop
pos = 0
for i, bs in enumerate(packed_seq.batch_sizes):
    values_new[pos: pos + bs] = values_old[pos: pos + bs] * dropout_mask[:bs]
    pos += bs

or so would give you that. Because it is a common idea: The Thomas rule of thumb says: If your hidden_dim has >= three digits, I would not worry about the for loop until you find it to be a bottleneck.
Best regards
Thomas