I can't help you on the online part, but abilities go in a lot of places in the PokeBattle scripts. Most of them are in PokeBattle_Battler. These are some functions abilities can be found in:
def pbCheckForm: This function handles form changes. def pbResetForm underneath resets the forms of those species at the end of each battle, I think.
def pbAbilitiesOnSwitchIn: This function activates abilities that should trigger when a Pokémon is switched in. It doesn't matter how the Pokémon is switched in, I think.
def pbEffectsOnDealingDamage: This function is activated right after the move hit. A lot of abilities can go here: form change triggering abilities, status inducing abilities, stat lowering abilities,
def pbEffectsAfterHit: This function appears to kind of extend the function above. Not too sure on this one.
def pbAbilityCureCheck: This function checks to see if the Pokémon has an effect that its ability would heal. This can also go in the code that triggers it, but it's here for organization purposes, I guess.
def pbSuccessCheck: This function is activated before the move hits. It will check to see if the move can actually hit the target because of its typing, ability, and items. This is also where abilities that give priority to moves is handled.
There's one more function worth mentioning, which resides in PokeBattle_Battle.
def pbEndOfRoundPhase: This function handles all effects that should trigger at the end of each round. This might be useful for an ability, move, or PBEffect you want to make.