The best way to write dialogue in different accents is to hear your characters speak with those accents in your own head, first.
That said, there are some differences that are well documented:
- Spelling, as you've mentioned.
- Vocabulary, e.g. Apartment (US) vs Flat (UK), Sidewalk (US) vs Pavement (UK).
- Prepositions, e.g. On the weekend (US) vs At the weekend (UK).
- Past Tense. Americans tend to use the past simple when describing something that has recently occurred, while people in the UK are more likely to use the present perfect. e.g. I went to the store (US) vs I’ve been to the shop (UK).
- Irregular Verbs. e.g. leaped, dreamed, burned, learned (US) vs leapt, dreamt, burnt, learnt (UK)
There are numerous others.
One thing to watch out for is that people in both countries tend to emulate the speech patterns of the other. American TV and films are popular in the UK, and they have had a significant effect on the language. Moreover, when Americans and Brits talk to each other, their speech patterns tend to be more similar than when they are apart.
Something else worth mentioning is that there isn't a British accent, nor a US accent; there are many. Here in the UK, accent can vary considerably between people from different parts of the country, as well as by age, social background, education, context, and who a person is talking to. These differences are sufficiently pronounced that locals can often tell which part of town someone is from. As a result, a native can guess a lot about a person's back story from the way they talk. (I imagine a similar thing occurs in the US - even as a Brit, I can tell the difference between speech from, say, Texas and California.
The past is, as they say, a foreign country, so the way my parents talked at my age is different from the way I talk.
Interestinly, if someone moves (physically or socially) they're likely to take on speech patterns of their new neighbours, but revert to older patterns when they meet people from their original background.
One consequence of all this is that it is easy to get it wrong. Every Brit knows how jarring it can be when a non-British actor plays an Englishman, but they get the accent wrong. The English just don't say, "What-ho chaps!" these days.
If you're really stuck, your best bet might be to ask natives of each country to check your writing to verify that it seems natural to them.