There is aa basic script already included in version 7 I beleive. It's called FPS_Guard01 (or something along those lines.) It will basically move into your melee range whilst stopping to shoot every once in a while.