How to add attributes to existing items

Yup! What you're doing works just fine, with some minor tweaks.

To apply the attribute modifier to the item, you need to do this instead:

/entitydata @e[type=Item,r=1] {Item:{tag:{AttributeModifiers:[{<attribute stuffs>}]}}}

Here is the updated command syntax for 1.13+:

/data merge entity @e[type=item,distance=..5,limit=1] {Item:{tag:{AttributeModifiers:[{<attribute stuff>}]}}}