With some minor change I guess you can just use the tool Add Attachments—Help | ArcGIS Desktop without the need for scripting.