Depending on the version of D&D you use, you should be able to modify based on raw scores on the fly.
3rd edition, for example, you could calculate the modifier with floor [(score-10)/2] (Not in twine code)
you would have 18 be a +4, a 15 as +2, 10 is a +0 and 6 would be a -2. It also means you have near infinite scalability
I would expect it would be a lot easier than trying to have a table with all possibilities.
If later editions used different numbers, its just a matter of finding a mathematical conversion that works