Could it cause a lot of damage to the engine if I drove my 1989 Toyota Corolla approximately 11km before I realized what the problem was?
Please make it clear: disconnected or loose?
Disconnected meant a permanent misfire, which may not cause much damage to the engine, except possibly faster wear on the bore.
Loose on the thread may damage the thread which may need repair, this can be done in-situ but if the damage is too much then it may possibly mean a new cylinder head.
A completely loose plug, where it can freely turn, could cause damage to threads in the cylinder head, which is aluminum. The spark plug threads are steel, and are harder than the aluminum.
However, based upon extensive experience including quite a few engines which had less than hand tight spark plugs, and ran for much longer in that condition, I doubt you have any damage in a 11 km drive around town. Around the track might be different.
One plane I was ferrying across the Atlantic wasn't quite running where I expected it to be. On my last stop before going out over the ocean, I always pull a couple of plugs and look at them for any signs of problems. This was a single engine plane, I picked it up in Fort Collins, CO, and now in northeastern Canada, I found that all 12 spark plugs were hardly hand tight. Each spark plug hole was inspected, and the plugs were torqued in correctly. There was no damage, despite a 2400 mile flight, and the ferry flight was unremarkable. The wires held the plugs in place, and kept them from backing out all the way.
If you had the plug in all the way, but perhaps not torqued up, there will be no damage, whether the wire was connected or not. The plug could have some fuel and oil on it, if the wire was not connected, but that would burn off the first minute or so of operation.
If one were to damage the cylinder threads, there are thread inserts, one brand being Heli-coil, which can be installed. This involves tapping out a larger hole, and then threading in with a tool, a coiled insert which becomes the new threads. In some cases, and for some applications, heli-coil type inserts are installed on softer metal, as they provide greater holding power than just aluminum threads, and the coil insert is much more wear resistant to wear from frequent use. This is not normally seen on car engines, but might be used, for example, on test fixtures.
It is likely that in the last 20 years the engine has suffered greater insult than this incident.