As for buying spells. Just create an item in a shop based off any item and remove all the items abilities. Then, create a trigger so that when the unit purchases this item, the item is destroyed and the unit has a new ability. It would probably look something like this.
Event: Item - Hero aquires an item
conditions: Item being manipulated equal to bash
actions:
Hero - add ability bash to unit (triggering unit)
And as for making the icons dissappear, I've done it on accident a few times but im not really sure how to make it work. An alternative would be to create a spellbook ability for the hero so that everytime the hero buys the item the ability is added to the spellbook. You'll hafta look in resources and look for it (i know its been done before)