I would generally use a resizable list box with a scroll. Because if there are more documents open than the height of the monitor, the interface with buttons will be cut off. Technical limitations of Illustrator.
On macOS with the "palette" type interface, Adobe has a bug that causes the script interface to move behind the Illustrator window on every click in the document. This bug does not exist on PC. Mac users should run the script from the File > Scripts menu to avoid this bug.
/*
DocumentSwitcher.jsx for Adobe Illustrator
Description: Displays a list of currently open documents and allows you to activate any document with a single click.
Discussion: https://community.adobe.com/t5/illustrator-discussions/display-opened-windows-in-a-panel-as-a-buttons/td-p/14745128
Date: July, 2024
Author: Sergey Osokin, https://github.com/creold
FOR MAC OS: Run the script from File > Scripts. This avoids the z-ordering problem of the script window.
*/
#target illustrator
#targetengine docSwitcher
(function () {
// Save the current order because after activating doc all array reordered
var docs = getDocsInfo();
var win = new Window("palette", "Document Switcher", undefined, {resizeable: true});
win.preferredSize.width = 200;
win.spacing = 20;
win.alignChildren = ["fill", "fill"];
var listbox = win.add("listbox", undefined, undefined,
{
numberOfColumns: 2,
showHeaders: true,
columnTitles: ["#", "Document Name"],
multiselect: false
});
addList(docs);
var btnClose = win.add("button", undefined, "Close");
btnClose.alignment = ["center", "bottom"];
listbox.onChange = function () {
selectListItem(docs);
}
btnClose.onClick = function () {
win.close();
}
win.onResizing = function () {
this.layout.resize();
}
win.onActivate = function () {
if (listbox.children.length !== app.documents.length) {
sendDocumentList();
}
}
// Add opened documents list
function addList(arr) {
listbox.removeAll();
for (var i = 0; i < arr.length; i++) {
var row = listbox.add("item", i + 1);
row.subItems[0].text = arr[i].name;
}
}
// Select list items and zoom to them contents
function selectListItem(arr) {
for (var i = 0; i < listbox.children.length; i++) {
if (listbox.children[i].selected) {
sendMessage(arr[i].path, arr[i].name);
}
}
}
function sendDocumentList() {
var bt = new BridgeTalk();
bt.target = BridgeTalk.appSpecifier;
var msg = getDocsInfo + "\rgetDocsInfo().toSource()";
bt.body = msg;
bt.onResult = function(result) {
docs = eval(result.body);
addList(docs);
};
bt.send();
}
// Get documents info
function getDocsInfo() {
var arr = [];
for (var i = 0; i < app.documents.length; i++) {
arr.push({
name: app.documents[i].name,
path: app.documents[i].fullName
});
}
return arr;
}
function sendMessage(docPath, docName) {
var bt = new BridgeTalk();
bt.target = BridgeTalk.appSpecifier;
var msg = switchDoc + "\rswitchDoc(" + docPath.toSource() + "," + docName.toSource() + ");";
bt.body = msg;
bt.send();
}
function switchDoc(docPath, docName) {
var f = new File(docPath);
if (f.exists) {
app.open(new File(docPath));
} else {
app.documents[docName].activate();
}
}
win.center();
win.show();
})();

Upd 1: Dialog is now resizable. Fixed for PC
Upd 2: After opening or closing documents, the panel updates the list