I encountered this problem too in one of my channels.
Luckily people logged into the bot to access certain of its features, so it was easy to assign everyone a default nickname (their login), and then use that as a variable name, and assigning their current nick to that.
So:
%loginname current-nickname
From there it's a breeze keeping that info up to date.

Unfortunately, without that login your stats will most likely be misrepresented; what happens if someone with an identical nick to someone else enters (the first person being offline ofcourse) and the stats can't tell the difference ?

A login is the best way to go, I think.