It's kind of a strange request if you ask me - items in RM aren't (by default) instance-based, so if you rename an item then you rename every type of that item. It's not like you can give a Long Sword some special name and still have other items that are Long Swords - they would all take that special name. As such, this type of script is only very narrowly applicable to games where you only ever receive one of any renamable type of weapon, or else a god game where it would make sense that the name you give something then applies to all items everywhere.
In any case, it's pretty simple, so I can do it, but I wanted to first make sure that you understood that items aren't instance-based in RM - that the name given will then apply to all types of that item.