Calculations/Evaluations are not part of the lightweight template engine NodeBB uses. (AFAIK)
I guess the best would be to intercept the filter:post.getPosts hook and add your custom index values...
Will it work Ok (I mean performance), - widget zone in every post?
I'm thinking about widget zone under avatar in post.
That's a good question
Unfortunately I don't think the widget rendering code gets activated on infinite scroll (but it would on pagination mode)
I can make that change though (post a GH issue if you decide to pursue this).
As for performance, I think it would be okay. It would make an extra call per page loaded as opposed to one call per post. That said, haven't tried it yet, so YMMV