How can we deal with the following problem pertaining to scripts? Sometimes for the same screen SAP has two (or more) dynpros, for example the 100 or the 101, and if we have developed the script for 100, it doesn't work because we are in 101. For example, the SAPLSMTR_NAVIGATION.S0100.txt and the
SAPLSMTR_NAVIGATION.S0101.txt are scripts for the same SAP screen with two dynpros.
Do we have to duplicate all the scripts for the different dynpros of the same screen?

No, this is not necessary. You can use an "Include" statement.