There is no way to detect if you currently swap the bars afaik.
You'd either have to check the vanilla game code and see if the lua provides that but I doubt it, it will be handled at the C code outside of lua which we cannot reach (as the private function also tell us: Do not touch
).
Only the events telling you as the bar swap finished.
You can use the event and check the parameter "locked". Maybe it fires multiple times for a weapon bar change, like 1st with locked = true and old barId, then locked = false and new barId?
You'd have to test this.
About stealing addon code please read this and follow the rules if you want to revive any addon:
https://www.esoui.com/forums/showthread.php?t=9865
-> If you request an addon fix/update/revive
-> If you want to take-over an abandoned addon/Before creating a patch/copy of an addon