One way might be to look into Player Quests and use the EVENT_LEVEL_UP event to trigger some spell additions.
From the changelog announcing player quests:
KLS: Added player quests, player quests are quests designed to be attached to player processes such as zoning and clicking objects.
KLS: Player quests are loaded as either 'quests/zonename/player.pl' or as a template in 'quests/template/player.pl'
KLS: Player quests will export qglobals the client should be able to see and the following events are available for player quests:
EVENT_TIMER with var $timer
EVENT_CLICKDOOR with var $doorid
EVENT_LOOT with vars $looted_id and $looted_charges
EVENT_ZONE with var $target_zone_id
EVENT_ENTERZONE with no special var
EVENT_LEVEL_UP with no special var
And here is the best Wiki documentation on the topic:
Link
Given the player quest feature and the functions that AndMetal pointed out, you should be able to get close to the functionality you're describing.