Depending of what you want to add
newitem = RPG::Item.new
newitem.name = 'new added item'
newitem.icon_index = 10
newitem.description = 'This is a new item added by script'
newitem.id = $data_items.nitems+1
#Get the last item in the data_items
to add a new item to the Database, after you created all the items you wanted like a upgraded weapons save your new database, if you dont all save done with a upgraded weapon added gonna make the save bug with a error, for saving just do a dump like :
Depending on the file you have modified too Items.rvdata for items, Weapons.rvdata for weapons ect...
file = File.open("Items.rvdata", "wb")
The only prob with this is when you will test your game and add a new items after you saved it with the Marshal.dump
the item will be added in the "Database" of your rpg maker project too, all items added and saved in game will appears in the editor too