Upvote:13
The simple answer is that there is no way to be sure what will happen to you when you return to the US. It is likely that you will be allowed enter the country, but also possible that you will be refused entry.
There is no written law as far as how frequently a traveler can visit the US under the Visa Waiver Program (ie, what you enter under when using an ESTA), nor how long their total time in the US can be as long as they exit by the time they are given for each trip (normally 90 days, but it can be less).
However US Customs & Border Patrol do have a "rule of thumb" that you should be spending more time outside of the US than within it. This is the rule that caused you to be send to 'secondary' inspection on your previous trip, as you had spent 3 months within the US, and then only a matter of weeks out of the country before returning. As this is only a guideline and not a formal rule, you were allowed in - likely in part due to your claim you were only staying for one week.
For your next trip, this rule of thumb will obviously not apply, as you've spent over a year outside of the US, so from that perspective you'll be fine.
The concerns is that if the CBP officer looks at your history, they will see that for your previous stay you stated you were only going to stay one week, but ended up staying ~3 months. That will potentially be treated as a red flag that could lead to you being sent to secondary inspection again, and questioned about the prior trip.
As I said at the start, nobody can say whether this will actually happen, nor what the outcome will be. It's possible they will let you in for a full 90 days, for a more limited time period, or not let you in at all - based on anything from your answers to any questions they ask, their impression of whether they think you may overstay on this trip, whether the officer involved has had his morning coffee yet, or any number of other things. If I had to guess I'd say you will be let into the US, but that's really just a guess and in no way guaranteed.
Note that I'm presuming you were actually granted 90 days of status on your second trip last year. Given you stated you were only planning to stay for a week it's not uncommon for them to only admit you for a shorter time period, in which case you would have overstayed by staying the full ~3 months. You will need to check the stamp in your passport (or the "Admit Until" date on your latest I94 record on the CBP website) for that entry and make sure that you departed before the date written below it. If you stayed beyond that date, then you have overstayed and the situation will be very different (in particular, your current ESTA is no longer valid).