I'm afraid your document doesn't make much sense to me. I don't quite understand what you're doing. But macro's are a bad idea. Macro's are generally very slow compared to the qlikview calculation engine. Using macro's can be great way to cause performance problems.
If you want to be able to pick between expressions in a chart then there are better ways. First of all have a look at these blog posts:
And now have a look at this document:
To use user-defined functions within qlikview objects you would need to enable them within the easter eggs - whereby those configurations aren't supported from qlik and are generally not recommended for using. And even with this won't be an eval() work then the result will be only a string for qlikview and not an expression and you would again need the $-sign expansion which couldn't be applied to get different results on row-level.
Therefore the only solution is to create an expression-chain with if-loops respectively significantely easier to create and better performing a pick-nesting. It's not really a beginner-stuff but not too complicated for use and mostly it worked quite smoothly and performant - whereby it will be of course quite slow if you want to apply it on a very atomic level with huge amounts of data. But on this level it makes not much sense - really useful might it be on higher consolidated data. Therefore I suggest you followed the suggestions from Gysbert.
For others to get a better impression about what we talk, see: Dynamic expressions without Pick.