Abandon any hope of using chatGPT or any LLM-based AI with roll20.
If something can be created as pure javascript or htnl, it can be made with AI, but if it needs *any* roll20 specific features, it can't - and APIscripts always do.
LLMs need vast, vast userbases of existing code to draw from across the web. Javascript and HTML code samples exist in such numbers, but roll20 doesn't.
Now if you know the fundamentals of how to build Roll20 scripts, you could use chatGPT to make the job easier: get a javascript function out of it that does something like you describe, then tweak it to work in the roll20 API.
I don't see why you'd need to use chatGPT to do what you describe though - you just need a list of names, and build a rollable table - something like the Table Import script would do the trick.