May be difficult, but is there a way to tie that to wars and enemies (other cols with bad relations).
Possible but it would
not really make it more interesting or
change anything for gameplay.

(Other than being more rare - it already now is not triggered too often, do not worry.)
A) They would
attack you anyways and you would
kill them anyways or loose your city if you fail.
B) If we tie it to a condition "being at war" or any other "restriction", it would
only be a little more rare.
C) The "Revolting Slaves" are generally
relatively weak and most - almost all - Colonial Units have really good chances of beating them.
D) They currently have "hidden nationality" (to prevent being displayed as owned by "Wild Animals") so you
would not even know which Nation they belong to.
E) If they would join another Nation that is
not at War with you
and not have hidden Nationality -
they could not attack you and also
you could not attack them.
In the future - once it is implemented - they will
join "Pirate Civ" though - which is supposed to be an "independent Nation fighting the existing colonial system".

For most historical slave revolts the slaves did not really want to join other European Colonies - they wanted to be independend and free - there were of course a few exceptions to that.
That way criminals and slaves won't just revolt and be a nuisance you can easily kill, but may revolt and join your enemies.
As I said, "who they join" does currently not make a difference for gameplay
if their AI behaviour is the same (and I currently do not want to invest
effort of recoding their AI).
The chance could be tied to how many guard units you have in each colony.
It would basically only make the feature more rare again.

Because already now you need to keep some defenses in your cities to guard them, or your cities themselves will trigger an uprest.
Summary:
The result for
gameplay would pretty much always be the same - no matter who they join.
(In the future they are supposed to join
"Pirate Civ" though - and will not need "hidden nationality" anymore - which currently simply prevents them from being displayed as Nation "Wild Animals".)
If you have a
City with lots of Slaves you need
more Military to defend the City - because Revolting Slaves are a danger even if they are not that strong.
Once the Slaves revolt,
they will attack you and if they are beaten
they are killed - if they kill all City defenders you loose the City.
So
having many Slaves has now become a
danger for the security of your Cities.
So you should
consider that in your strategy when playing with lots of Slaves.
Restrictive conditions (e.g. being at War) will only make the feature more rare and thus reduce its gameplay importance.
(That however can be done much more easily with the balancing modifiers added in XML.)
General Remark:
The current feature "Revolting Slaves" is generally a
new base component.
The
other additional change "Slaves can now become free" (as "Freed Slaves" or "Converted Natives") is as well.
It could be used e.g. by
Python Event System or expanded in other ways in the future.
Before we already discuss changing it,
please at least give it a try once it is released.