Curious if there is a need to use batch at all in what your trying to achieve? I have used system calls to DOS environment from within programs that aren't in the root of the system, so for example with C++ and PERL I have used system calls and these languages allow for far more than Batch Files themselves. *System Calls from C++ etc, some see as poor programming practice though, but they work. They are ok for applications where you yourself are using them and others dont interact with them.
SED is good, but I have used mostly PERL for making batched like scripts do what I want and without the limits of batch itself.