if we are in level 1, both the levels 2 and 3 are pressed it should go
to level 2 even if level 3 was pressed first.
For this to work, the program should remember which buttons (mind the
plural!) have been pressed. Thus, instead of remembering only one
request, as in
int required_level =-1;
it should have a boolean variable for each of the possible ...
It sounds like you need to watch both encoder outputs and don't let one get ahead of the other. Naturally, they won't sync exactly (i.e., pulse simultaneously) but you can set a limit on how many counts to let them differ by, before pausing the faster actuator while the slower one catches up.
If you need to save positions across a power failure, you'll need ...