This is how you can express the signed overflow flag value for addition of two signed (2's complement) 32-bit integers:
OV = (((SRC XOR DST) XOR 80000000H) AND ((SRC + DST) XOR SRC) AND 80000000H) ≠ 0
SRC and DST are the entire 32-bit integer values.
The expression essentially compares the signs of the sum and of the addends.
Expressing the overflow solely in terms of individual bits isn't very practical because you'd need to effectively replicate a full 32-bit adder. And that's not a good candidate for one-lining.
If you want a similar expression for subtraction, try to derive it or just express subtraction in terms of addition as is done in the Sbb()
function in this answer. It shouldn't be hard.
Using a test to make sure your code works is a good idea, too. You can even write a small assembly routine for addition/subtraction that would return you the overflow flag and use that to test correctness of your one-liner.