Hi, welcome to the forum.
cWorld has the DoWithChestAt() function which lets you have any Lua function called with the cChestEntity parameter representing the chest: http://mc-server.xoft.cz/LuaAPI/cWorld.html
Then you can simply use the cChestEntity's SetSlot() function to set the slots: http://mc-server.xoft.cz/LuaAPI/cChestEntity.html
You'll need to handle the "random" part yourself in the plugin
cWorld has the DoWithChestAt() function which lets you have any Lua function called with the cChestEntity parameter representing the chest: http://mc-server.xoft.cz/LuaAPI/cWorld.html
Then you can simply use the cChestEntity's SetSlot() function to set the slots: http://mc-server.xoft.cz/LuaAPI/cChestEntity.html
You'll need to handle the "random" part yourself in the plugin