I don't see why it's impossible to replace, the id is just one of the many properties a RS2Widget object has. Take a look through all methods, there's at least 10 different ways of identifying a widget and id is only 1 of them (easiest and worst at the same time) https://osbot.org/api/org/osbot/rs07/api/ui/RS2Widget.html
eg: filter by actions, filter by position, filter by message, filter by color BUT NOT filter by id. The simple reason behind this is the properties I mentioned are all exposed to the human player, while abstract numbers such as ids and indexes are not visible to normal players, and jagex can change them whenever they want without affecting the legit players. They do this about once a month for the tutorial island widgets just to break all scripts coded by people who use these properties.
As for the sleeps, if I ask you why 300 and not 301, and you can't give a serious answer to this, then it is an obviously flawed logic. A better approach would be waiting until something happens aka conditional sleep.