They can erase all data, or stuck it in an unending loop.
Even if you write a JMP that jumps to itself (and will do that forever), what's to stop the operator from just resetting it and wiping out the virus? If you got it onto a storage medium, what's to stop him from restoring from backup? And so on. You'd need something more sophisticated and custom-designed, e.g. something to give you a backdoor into their systems over their external ship-to-ship radio system so that you can just command their shields to turn off or whatever. Assuming they have shields. Locking up their computer would just stop them from issuing commands temporarily (of course, if you can blow them to smithereens before they can fix it...).
You all now there's such a thing as closed circuit computing right. Good luck infecting a computer with a virus when you can't reach it.
Considering how popular Battlestar Galactica is, I expect that if some form of ship-to-ship wireless hacking becomes a thing, a Galactica-like no-networked-computers protocol would be put in place by anyone familiar with the reimagined series, or with the concept in general.
But considering that humans aren't cylons or AIs, and you're going to be running super-slow obsolete CPUs in these spaceships, I suspect in-game CPU jamming (send enough data from enough sources to prevent a listening device from sorting through it all in a timely fashion to hear any authentic sources) might be a more effective weapon (Probably depending on the implementation of the system as to whether it would work in networked devices, radio communication, or neither). (More effective than trying to reverse engineer the enemy system to figure out how to fiddle with their shields or cause their power plant or engines to overload and self-destruct, that is.)