Not 100% but you may run into hardcoded issues here. I'm pretty certain that for Creature Weapons, for some unknown reason, they hardcoded those feats, even though there are columns in baseitems.2da for it.
However, i know that when you create new weapon types it does respect those columns and the feats you set there.
By the way, it requires no scripting/coding.
Simply edit the 2da, find the weapon type you want to change, find the column for the feats you want to change, and edit the feat id in that column. Not certain, but i guess it will work with any feat you put there, it doesn't even have to be a weapon focus/spec feat. I guess if you put the number for Blind Fight in for Weapon Focus (Longsword) then it would give the +1 bonus for longsword if you took Blind Fight (although it would be rather silly).
Just conjecture on my part, not tested.