I don't think being a foreigner is really the most imporant
concern here. If a US citizen makes "too many" entries
back into the US, he/she will no doubt raise the eyebrows
of the CBP officers.
If you have nothing to hide, there's really nothing to worry
about. However, if you feel that you were subjected to
unreasonable delays/searchs, you can always send in a
complaint to them...