S -> aSb | bSa | SS | ϵ
If I’m not completely wrong here, the only issue here is the left recursion of S, so if you remove that, you should be fine:
S -> S' S'
S' -> aSb | bSa | ϵ
This should also eliminate ambiguity.
An alternative solution could be this:
S -> aSbS | bSaS | ϵ