Fora a moment i thought we only have this trigger https://github.com/Elgg/Elgg/blob/master/engine/lib/upgrade.php#L263

I like idea of supporting plugin level upgrade scripts. Probably they could be slightly smarter and take into account making upgrade with disabled plugin and than enabling it, so we'd neet to track separately if particular plugin was upgraded already between some versions. It could live as ElggPlugin metadata to avoid problems with plugins having the same dir name. At the beginning we're probably fine with simpler version.