that would require the 'AI' to do something that computers are really good at - detect when a particular event (perfectly toasted) has been achieved via inputs monitored at the millisecond without deviation and then change a state - toasting to not toasting - based on detecting that event.
A toaster must obey the doneness setting given it by human beings except where such orders would conflict with the First Law.
A toaster must protect its own existence as long as such protection does not conflict with the First or Second Law.