Yes, it’s fine to do that way.
There will be increased “suspicion” of your visits, make sure to (1) take proof with you that you’ll be returning to the uk to wait it out (letter from employer, etc) and (2) don’t visit too often for too long - general rule of thumb is twice as long out of US as in it.