Would you mind doing a little testing to help me figure out what's wrong? Let's make a pair of extremely simple hotkeys in a new script all by themselves.

Please drag WoW1 and/or WoW2 so they partly overlap so you can see if the foreground window changes.

Code:
<Hotkey F1>
   <TargetWin WoW1>
   <SetForegroundWin>

<Hotkey F2>
   <TargetWin WoW2>
   <SetForegroundWin>
Do those work?