I'm well aware that double battles weren't really considered in the original design. It's unfortunate and we have been planning to make changes one of these days to allow for n v. n. And yes, the rate at which bugs have been fixed has slowed down lately, but bearzly and I are only human and this is not a job.
This is true, and the solution is to use the "other pokemon involved in the attack" rather than then "opponent", and not to check the "other pokemon in the attack" for multiplier statuses if the two "pokemon involved in the attack" are the same. (In the source which I am about to link to I use the word "target" for "other pokemon in the attack", but this is just because it's shorter.) To be fair this is hardly the most obvious situation, and it's surprisingly easy to fix actually, and this solution actually should work for n v. n as well. The reason I mention this is that you make it sound as if this is a serious problem as opposed to something that is apparently trivial to fix.You can review my solution here:
1,
2 in case you would like to check for additional oversights.
The version with the bug was never live, so thanks for helping us avoid this potential issue.