Use this to update Module:scripts/by name and Module:scripts/code to canonical name.

return {
	["Adlam"] = "Adlm",
	["Afaka"] = "Afak",
	["Ahom"] = "Ahom",
	["Anatolian Hieroglyphs"] = "Hluw",
	["Arabic"] = "Arab",
	["Armenian"] = "Armn",
	["Avestan"] = "Avst",
	["Balinese"] = "Bali",
	["Bamum"] = "Bamu",
	["Bassa"] = "Bass",
	["Batak"] = "Batk",
	["Baybayin"] = "Tglg",
	["Bengali"] = "Beng",
	["Bhaiksuki"] = "Bhks",
	["Book Pahlavi"] = "Phlv",
	["Brahmi"] = "Brah",
	["Braille"] = "Brai",
	["Buginese"] = "Bugi",
	["Buhid"] = "Buhd",
	["Burmese"] = "Mymr",
	["Canadian syllabics"] = "Cans",
	["Carian"] = "Cari",
	["Caucasian Albanian"] = "Aghb",
	["Chakma"] = "Cakm",
	["Cham"] = "Cham",
	["Cherokee"] = "Cher",
	["Coptic"] = "Copt",
	["Cuneiform"] = "Xsux",
	["Cypriot"] = "Cprt",
	["Cyrillic"] = "Cyrl",
	["Demotic"] = "Egyd",
	["Deseret"] = "Dsrt",
	["Devanagari"] = "Deva",
	["Dogra"] = "Dogr",
	["Duployan"] = "Dupl",
	["Egyptian hieroglyphic"] = "Egyp",
	["Elbasan"] = "Elba",
	["Ethiopic"] = "Ethi",
	["Fraktur"] = "Latf",
	["Georgian"] = "Geor",
	["Glagolitic"] = "Glag",
	["Gothic"] = "Goth",
	["Grantha"] = "Gran",
	["Greek"] = "Grek",
	["Gujarati"] = "Gujr",
	["Gunjala Gondi"] = "Gong",
	["Gurmukhi"] = "Guru",
	["Han"] = "Hani",
	["Hangul"] = "Hang",
	["Hanifi Rohingya"] = "Rohg",
	["Hanunoo"] = "Hano",
	["Hatran"] = "Hatr",
	["Hebrew"] = "Hebr",
	["Hiragana"] = "Hira",
	["Hmong"] = "Hmng",
	["Iberian"] = "Ibrn",
	["Image-rendered"] = "Imag",
	["Imperial Aramaic"] = "Armi",
	["Indus"] = "Inds",
	["Inscriptional Pahlavi"] = "Phli",
	["Inscriptional Parthian"] = "Prti",
	["International Phonetic Alphabet"] = "IPAchar",
	["Japanese"] = "Jpan",
	["Javanese"] = "Java",
	["Jurchen"] = "Jurc",
	["Kaithi"] = "Kthi",
	["Kannada"] = "Knda",
	["Katakana"] = "Kana",
	["Kayah Li"] = "Kali",
	["Kharoshthi"] = "Khar",
	["Khitan Large"] = "Kitl",
	["Khitan Small"] = "Kits",
	["Khmer"] = "Khmr",
	["Khojki"] = "Khoj",
	["Khudawadi"] = "Sind",
	["Khutsuri"] = "Geok",
	["Korean"] = "Kore",
	["Lao"] = "Laoo",
	["Latin"] = "Latn",
	["Leke"] = "Leke",
	["Lepcha"] = "Lepc",
	["Limbu"] = "Limb",
	["Linear A"] = "Lina",
	["Linear B"] = "Linb",
	["Lisu"] = "Lisu",
	["Lycian"] = "Lyci",
	["Lydian"] = "Lydi",
	["Mahajani"] = "Mahj",
	["Makasar"] = "Maka",
	["Malayalam"] = "Mlym",
	["Mandaic"] = "Mand",
	["Manichaean"] = "Mani",
	["Marchen"] = "Marc",
	["Masaram Gondi"] = "Gonm",
	["Maya"] = "Maya",
	["Medefaidrin"] = "Medf",
	["Meitei Mayek"] = "Mtei",
	["Mende"] = "Mend",
	["Meroitic cursive"] = "Merc",
	["Meroitic hieroglyphic"] = "Mero",
	["Modi"] = "Modi",
	["Mongolian"] = "Mong",
	["Mro"] = "Mroo",
	["Multani"] = "Mult",
	["N'Ko"] = "Nkoo",
	["Nabataean"] = "Nbat",
	["New Tai Lue"] = "Talu",
	["Newa"] = "Newa",
	["Nushu"] = "Nshu",
	["Ogham"] = "Ogam",
	["Ol Chiki"] = "Olck",
	["Old Cyrillic"] = "Cyrs",
	["Old Hungarian"] = "Hung",
	["Old Italic"] = "Ital",
	["Old North Arabian"] = "Narb",
	["Old Permic"] = "Perm",
	["Old Persian"] = "Xpeo",
	["Old Sogdian"] = "Sogo",
	["Old South Arabian"] = "Sarb",
	["Oriya"] = "Orya",
	["Orkhon runes"] = "Orkh",
	["Osage"] = "Osge",
	["Osmanya"] = "Osma",
	["Palmyrene"] = "Palm",
	["Pau Cin Hau"] = "Pauc",
	["Phags-pa"] = "Phag",
	["Phoenician"] = "Phnx",
	["Pollard"] = "Plrd",
	["Psalter Pahlavi"] = "Phlp",
	["Rejang"] = "Rjng",
	["Runic"] = "Runr",
	["Samaritan"] = "Samr",
	["Saurashtra"] = "Saur",
	["Sharada"] = "Shrd",
	["Shavian"] = "Shaw",
	["Siddham"] = "Sidd",
	["SignWriting"] = "Sgnw",
	["Simplified Han"] = "Hans",
	["Sinhalese"] = "Sinh",
	["Sogdian"] = "Sogd",
	["Sorang Sompeng"] = "Sora",
	["Soyombo"] = "Soyo",
	["Sundanese"] = "Sund",
	["Syloti Nagri"] = "Sylo",
	["Syriac"] = "Syrc",
	["Tagbanwa"] = "Tagb",
	["Tai Nüa"] = "Tale",
	["Tai Tham"] = "Lana",
	["Tai Viet"] = "Tavt",
	["Takri"] = "Takr",
	["Tamil"] = "Taml",
	["Tangut"] = "Tang",
	["Telugu"] = "Telu",
	["Tengwar"] = "Teng",
	["Thaana"] = "Thaa",
	["Thai"] = "Thai",
	["Tibetan"] = "Tibt",
	["Tifinagh"] = "Tfng",
	["Tirhuta"] = "Tirh",
	["Traditional Han"] = "Hant",
	["Ugaritic"] = "Ugar",
	["Unspecified"] = "None",
	["Vai"] = "Vaii",
	["Varang Kshiti"] = "Wara",
	["Yi"] = "Yiii",
	["Zanabazar Square"] = "Zanb",
	["Zhuyin"] = "Bopo",
	["mathematical notation"] = "Zmth",
	["symbol"] = "Zsym",
	["uncoded"] = "Zzzz",
	["undetermined"] = "Zyyy",
}

local export = {}

local function generate_table(name_to_code)
	local result = {}
	local script_data = mw.loadData("Module:scripts/data")
	
	local iterate
	if name_to_code then
		for code, data in pairs(script_data) do
			if #code == 4 or code == 'IPAchar' then
				result[data.canonicalName] = code
			end
		end
	else
		for code, data in pairs(script_data) do
			if #code == 4 or code == 'IPAchar' then
				result[code] = data.canonicalName
			end
		end
	end
	
	return result
end

local function dump(data, name_to_code)
	local output = { "return {" }
	local i = 1
	local sorted_pairs = require "Module:table".sortedPairs
	
	for k, v in sorted_pairs(data) do
		i = i + 1
		output[i] = ('\t[%q] = %q,'):format(k, v)
	end
	
	table.insert(output, "}")
	
	return table.concat(output, "\n")
end

function export.code_to_name(frame)
	return require "Module:debug".highlight(dump(generate_table(false), false))
end

function export.name_to_code(frame)
	return require "Module:debug".highlight(dump(generate_table(true), true))
end

return export