I want to make sure that we are on the same page and that I am not imagining the scenario that you want to achieve in the wrong way. I will combine my previous suggestion with a sample project and we can use that as a base line for our discussion. If it turns out to be totally off, please set me straight and try to give me a more concrete example to work with.
The attached sample project has 1 test, called BaseTest. This test navigates to Wikipedia's main page and I used only partial URL, because I plan to use baseURL. Then, the test will enter some text and search for it. The same test can be executed against the English version - https://en.wikipedia.org or the German version - https://de.wikipedia.org of the page, the same way as "dev" and "prod" environments.
I have 2 separate test lists called "GermanList" and "EnglishList", which only have that 1 test. The idea here is to have baseURL for each of those tests, so that they run against the different version of the application under test. You can achieve that with the Test List Settings, under the Web tab. I can see that I used different baseURLs for both test lists and they will run against the specified environment.
With that setup there is no need to get the test list name or other parameter, in order to set a specific baseURL to the test list. Please note that if there baseURL test list setting is empty, the test will use the project baseURL setting instead.
The feature request might take some time to be implemented and I want to help you in the present. Please let me know what do you think about the attached project and suggestion. If that does not work for you, I will appreciate if you can provide an example from your side, so I can help you with other suggestions.
Thank you for your understanding and cooperation in this discussion.