I appologize for belated response. Unfortunately I don't have any good news for you. You cannot use if-then control constructs in the expression on the righthand side of "select" statement. Also mapclass2node cannot be nested (wrapped) inside of other functions. It is intended to be the top-level function in a select statement.
What exactly do you need to achieve? Could you post example of configuration that you need to implement along with description what is supposed to do? What version of BIG-IP do you use (you've mentioned just 4.6.x)? Without having more information, it is really hard to offer any help.