First of all, we'll have to decide just what the caster level is.
If the item is meant to, say, allow a bard/cleric/SD to cast a spell they didn't choose on level-up, caster level refers to the Bard part.
If it's meant to let any character cast a spell even when they normally have no spellbook, caster level refers to the total character level.
But if two level 10 characters with the same Fireball spell item meet, would having more wizard levels be an advantage over a paladin or rogue, demanding a weighted average?
Factoring in spell feats, spontaneous casting, spells/day, metamagic, UMD checks and casting ability scores (is that Protection from Evil an INT, WIS or CHA spell item?) gives us three options.
The obvious one is changing every spell in the game to use an alternative caster level variable rather than the real caster level and so on whenever the spell comes from such an item.
Then we have the option of making the item cast a 'fake' spell, teleporting in an invisible NPC with the appropriate caster level and feats, and having them fire off the spell desired. Unfortunately the PC wouldn't get the xp for any kills, and I expect it wouldn't work for Caster Only spells either.
Lastly we can edit .2da files. This can be done either to give a sorcerer or the like more 'known' spells, or to add more CastSpell itemproperty options such as level 1, 2, 3, 4, 6, 7, 8, and 9 fireballs.
We do have items like the fear aura, which have their own script set and take level into account, just as if we'd go with option 1. But these are all designed to do one thing, instead of covering every spell configuration concievable, which makes things a lot more manageable in this case.
What we also have is the functionality to give items the CastSpell property in-game for all spell IDs and Charges/Use or Uses/Day, but as you know, that comes with limited level choices unless we'd drastically expand them using option 3.
Of course, if we're talking about divine magic, wizards or known spells, the BonusSpellSlot property, perhaps alongside a scroll to scribe, does the trick just fine without all the fuss.
I think it all boils down to what you want to do with the item. Something that creates a CastSpell property based on two variables is easily done, adding caster level means I'd rather work with specific spell items; if for instance you want a Lightning Bolt spell item we can change the Lightning Bolt script, but I see no point in spending hours updating all the spells we'll never use in this way
For a list of spell IDs, look through your .2da files.