You can do this with scripted sequences, assuming the model you are using has a suitable animation. Scientists for example have windive and crawlwindow animations. It would just be a case of setting up a sequence near the window and then triggering it to execute when the scientist gets within range. If you wanted other NPCs like Barney or the grunts to do it, they would need new animations.
If you wanted it to be dynamic, that might be a little more complicated and would definitely require coding. However given how the node graph works for AI in Goldsource, I suspect this would be quite tricky.