I don't believe Gearswap can pickup on a spell you don't have(please correct me if I'm wrong!), unlike spellcast where things like //poisoin5 were used.
However, within Gearswap there is pet.name('Titan','Shiva',etc). or pet.element('Fire','Thunder',etc). Obviously I'd recommend pet.name since a few share elements now.
If you're ok with using a macro and not really being type-out friendly, I'd just make custom commands under your user command function to handle desired BPs. Example:
Code
function self_command(command)
if command == 'Nuke2' then
if pet.name == 'Titan' then
send_command('stone2')
elseif pet.name == 'Ifrit' then
send_command('fire2')
....
There's a few more elegant ways to handle this, but this will work. You'd have to make a command for each of the sets you want(Nuke4, Buff1, etc) and define the inside of that command in a similar fashion so its a bit of writing. To execute the macro would be "/console gs c Nuke2", or whatever you set "command" equal to in place of Nuke2.
Second option would be canceling the spell and rechecking within the same subset of spells you'd want to replace it with. Example, you type //hastega, but have a different pet out:
Code
if spell.english == 'Hastega' and not pet.name == 'Garuda' then
cancel_spell()
if pet.name == 'Titan'
send_command(whatever spell titan has you'd want to use if not hastega)
elseif pet.name == 'Ifrit'
send_command(same thing for Ifrit)
...
The downside of this is its one way unless you define every possible outcome. Say you had Leviathan out, and Hastega and Spring Water are in the same set of spells for you. So you defined it the way I did, meaning //hastega cancels with Leviathan out and replaces with Spring Water. //springwater would not cancel back to Hastega with Garuda out unless you wrote the whole thing out again with Spring Water as your base spell. Though there is a way to write that out pretty efficiently without backtracking, its more than I'd really care to type out right now. I'm assuming the first option will cover your needs.