by Ken Task.
The answer to all three of those questions is probably yes, question is ... just how complicated does one need to be? I tend to follow the KISS theory.
Since you have CLI ninja skills, take a look at this OP's posting:
https://moodle.org/mod/forum/discuss.php?d=469657#p1885468
In particular, how to remove dups from quiz bank on shared hosting where OP cannot change DB server config.
'SoS', Ken