At my sister's wedding, her boss asked me to look at his tablet during the toast. I just smiled and said I'd check it later, keeping the focus on the celebration. A quick, kind response usually solves it without hurting the vibe.
Honestly that sounds like letting people walk all over you. If someone shoves a tablet at me during a toast, I'm not making future promises to fix their stuff. That's just rude of them. Diana_flores25 has the right idea about not letting it steal the moment, but I'd be more direct and say "not right now" with a smile. Being too nice just trains people to interrupt important times.
Used to get annoyed when people pulled out tech at family events, like my aunt showing me her cracked phone screen during cake cutting. Hearing how @oliver523 handled that tablet request really flipped it for me. It's not about the tech itself, it's about not letting it steal the moment. Now I'd probably just say "Let's catch up after the song" or something soft like that. Keeps the peace and the party moving.