How can I make two applications activate from an AppleScript app?
I think this may be what you're looking for.

set app1 to "TextEdit" -- Change as needed
set app2 to "Mail" -- Change as needed

if (application app1 is running or application app2 is running) or ¬
    (application app1 is running and application app2 is running) then
    tell application app1 to quit
    tell application app2 to quit
else
    tell application app1 to activate
    tell application app2 to activate
end if