generic way to convert imperative if-then-else statements into functional style?
As was mentioned in comments to the other question, any imperative program with side-effects can be trivially transformed into a pure program by simply lifting it into the IO monad, for example.

Or, by implementing an interpreter for an imperative language in a pure language.

That is, however, not good functional design. (Although, embedding a Domain Specific Language for side-effects into a program to provide limited and isolated side-effects in clearly demarcated sections of the code could certainly be considered good design.)

There is no general way of doing this translation. You need to understand what the original problem is that the program is solving, then solve that problem in a functional manner.