I dunno. The way I look at it, whatever you could have been working on to advance your company when Mixpanel took care of things, you weren't when you were building this and can't when you have to maintain it.
MixPanel costs $X per month. That cost only increases. Self-based solution costs $Y to build and $Z to operate.
delta = $Z x n - ($Y + $Z x n)
Solve for that delta.