I think gobln is being a playful troll though, considering his post has meme and smogon-children in the same sentence. The only time when we'll see bug type porygon is if the meta is overrun with dark and psychics, and even then there are plenty of strong bug types like mega scizor, genesect, buzzhole or pheromosa.
As for your problem a much simpler solution would be to simply attack with shadow ball instead of using z-conversion right away, since normal porygon is immune to ghost so the one using a ghost attack is probably a ghost type himself. You can even do this to finish of some pokemon rather than risk them getting an attack on you if you have a supereffective attack available, so keeping both ice beam and thunderbolt could be a good option, but then he could switch it for something that resists your attack... It's basically a problem of predicting what your opponent is going to do, and that is quite hard to master.
As for coverage options in the third slot for ghost porygon, i've read in the SM OU analisys write up thread that Hidden power fighting would be a good move for ghost porygon, presumably to deal with dark types that threaten it like bisharp, tyranitar and weavile (which have a 4x weakness to fighting), so you could change your team building to have a strong electric attacker like tapu koko or Xurkitree for the electric attacks instead of thunderbolt (which without adaptability, may not deal enough damage considering how bulky water types can be)
Considering how weak hidden power is in terms of base power (so it needs that quadruple weakness for damage), i've been wondering if electric porygon would benefit more from HP fire than HP ground, since the pokemon that have 4X weakness to fire are the likes of mega scizor, genesect, kartana, ferrothorn, forretress, abomasnow, A-sandslash, while the ones that have 4X weakness to ground are A-golem, togedemaru, magnezone, heatran, heat rotom, salazzle, nihilego, aggron. Of course, HP ground MAY be enough to take down electric type pokemon or pokemon with lightning rod/volt absorb that are problematic, since at double weakness it's stronger than a neutral ice beam, but it needs prior damage (like from stealth rock) to pull off an OHKO in many cases like the popular A-Marowak. Overall it probably depends on the current meta.