I think you are mixing together two separate things.
A magic Trainer teaches a school of magic, and raises your level in that school when you buy training.
A spell vendor sells you spells, which are normally mostly of one school, with a few basic spells from the others.
However, they are often the same person, and they are set up the same way. A seller of spells does not need a container to keep them in, but otherwise the tutorials on creating a merchant will help you.
Create an NPC and give them a Class of a mage type (Wizard, Sorcerer, or just Mage) and then click on the AI button. Check the box for spells if you want them to sell spells, the one for training (and select the school) if you want them to be a trainer. They sell the spells they know, so just add those to their Spell List. Finally make sure that at least one of the AI packages (not a "Sleep" one!) has the "offers services" option, or they'll never do any trade.