to be honest you should just request a return address from the depositor instead of reusing an old address, it would allow people to send coins from one wallet and receive with another plus you wouldn't have to do something as gross as determining the return address from the outputs.