Yes, it's fine. If you travel back to the UK, in fact, or anywhere other than Canada, Mexico, or the Caribbean, your subsequent visit should be on a new 90-day period, so you could be in the US for 60 days, in the UK for two weeks, and then in the US for 30 days or even 45 or 60.
If you travel for a short time to an adjacent country, however, your subsequent stay would need to be within your initial 90-day period. For example, if you spend 60 days in the US and then go to Canada for 15 days, you'll only be able to stay in the US for 15 days after you return.
The other thing you'd need to be careful of is border officers deciding that you're trying to use the visa waiver program to live in the US. If you spend a lot of time in the US with short trips to other countries, you can expect the questioning your receive on entry to the US to become more probing and more skeptical. If your second trip to the US is a short one for a wedding, this is unlikely to be a problem, particularly if you can prove your itinerary.