That's rather complicated because of its internal architecture. Also because Maxima is skewed towards interactive usage. Some of the routines need to ask you questions about the problem in the middle of the solution (things like "is a zero or non-zero?" and such). Perhaps such questions could be turned into conditions, though.
it would be cool if maxima could be used in such a way. similar to how sympy is used in python. i have a feeling it is definitely possible. maybe someone knows if any work on it has been done by some third party