The short answer is it's grammatically correct to say, "While I play I always win", but it doesn't have the meaning you intend.
"While" means "during the time", and "when" means "at the time" or "each time". So "while" can only refer to spans of time, and "when" can refer both to spans of time and instant events.
In your first examples, the continuous verbs, "cooking" and "playing", represent spans of time, so both "while" and "when" apply. In contrast, "came in" and "heard something" are both instant events which interrupt those continuous verbs, so only "when" applies.
So to your question, "play" can be referred to as a span of time, so it's grammatically correct to say "While I play I always win", but it doesn't have the meaning you intend. Since "while" only refers to a span of time, rather than a single event of playing, the implied contrast is with not playing at all, so it means, roughly:
During the time I play, I always win (and when I'm not playing, I don't always win).
The intended meaning is, "Each time I play, I win". This meaning can be expressed with "when", but not with "while" because here, "play" is a repeated event, rather than a span of time.