My analysis: nah, still WAY too complicated. Like, crazily complicated - if I ever wanted something like that, why not simply use PHB classes (and online character generators)?
Any NPC ally's levelling should be limited to something like:
* for every level the ally gains, add one Hit Die, and use the average method of increasing maximum hit points (don't roll).
* when the party/friend gains a proficiency bonus increase, the ally does too. This means +1 to attack rolls, ability checks (skills), saving throws and spell save DCs.
* when the party/friend levels into a new tier (=reaches levels 5, 11, or 16), add one more damage die (or set of damage dice) to each of the ally's attacks. (1d6 becomes 2d6 or maybe 1d12. 2d4 becomes 4d4 or perhaps better 2d8)
* the following concerns allies with primary spellcasting abilities, not every monster that can cast a spell.
** allies with spellcasting abilities gain one extra slot of its highest level each time it levels.
** allies with spellcasting abilities gain access to the next higher level of spells every other time it levels.
** as for which spells it can select, the player can give suggestions, but the decision is up to the DM. Make sure the player understands how the majority of 5E NPCs happily use substandard spells no discerning PC would ever use, and that there will be no minmax spell selection.
I wouldn't mess about with ability score increases. In some cases it can be appropriate to give the ally a signature feat (such as giving Great-Weapon Master to the barbarian woman when you've helped her become Chieftain of her tribe), but any more than that, and the NPC isn't simple anymore.
Likewise with magic items. If the player wants to equip the ally with a Flame Tongue, you can't very well deny him or her that, and the NPC attacks needs to be updated accordingly. But I would discourage item use in general. 5E monsters generally don't use items; their stat blocks are supposed to be sufficient as is. A NPC with many items isn't simple anymore.
NPCs that aren't simple any more should be recreated as full characters, and not be allowed to reach the same level as any party member.
Using both NPC stats (with their bloated hp totals) AND items, feats, and player class abilities is abusing the rules, and should be avoided. EITHER simple NPCs or underleveled classed characters with items and abilities. Not both.