- When you need something between a comma and period, use a semicolon.
- Where you need something between a comma and period, use a semicolon.
From a logical point of view, both sentences are correct, but the second one doesn't look idiomatic to me. (I could be wrong.)
On the other hand, Where possible looks better than When possible.
- When possible, use a period, not a semicolon.
- Where possible, use a period, not a semicolon.
- Are these observations correct?
- Generally, which word (When or Where) would be "better" to use in such cases? (Of course, it may be that there is no simple rule here.)
P.S. I don't consider If as a third option because it will change the meaning.
Edit: It seems plainlanguage.gov prefers when over where:
Use the word if for conditions. Use when (not where), if you need if to introduce another clause or if the condition occurs regularly. - https://plainlanguage.gov/guidelines/organize/place-the-main-idea-before-exceptions-and-conditions/