Those are my mainhand and offhand checks, dunno how much API has changed since TBC, but you might wanna try it:
var needsMainHandRefresh = Lua.LuaDoString<bool>("local hasMainHandEnchant, mainHandExpiration, _, _, _, _ = GetWeaponEnchantInfo(); return not hasMainHandEnchant or (mainHandExpiration / 1000 / 60) <= 15;");
var needsOffHandRefresh = Lua.LuaDoString<bool>("local _, _, _, hasOffHandEnchant, offHandExpiration, _ = GetWeaponEnchantInfo(); return not hasOffHandEnchant or (offHandExpiration / 1000 / 60) <= 15;");
Checks if enchant is missing at all, or remaining time is smaller than 15 minutes (you might wanna remove that or change value for your own purposes)