I trying to find out which one is correct.

That had been bothering me a bit for sometime. Or That had been bothering me a bit for some time.


I would have gone off anywhere at anytime to be with Ruby. Or I would have gone off anywhere at any time to be with Ruby.

Take a look at this definition:

As well as this one:

Does that help you draw your own conclusions?
1st question: some time (you're describing the "amount" of time you've been waiting, not the describing the verb or adding a "time" element to an action, as in: "Sometime I'd love to go to the opera with you".

2nd: if you use it after "at" it's always separate.
Otherwise: anytime (any non-specific point in time)
any time= an AMOUNT of time (again, a characteristic of the time is important)


I know you posted a while ago, but I hope it helps!