A book with occasional Spanish can be done entirely according to the rules of UEB. That means using contractions unless other rules apply; an accented letter within text that would otherwise be contracted means you cannot use the contraction. For example, in the word árbol the "ar" contraction cannot be used; on the other hand, the word caminar would be transcribed with the "in" contraction and the "ar" contraction.
"Occasional" or "incidental" foreign language text is not clearly defined in every case. For example, a novel could have a character that regularly says Spanish words, but it would be reasonable to do the whole thing in UEB. Books for foreign language learners or dual language texts are best done with UEB for the English and uncontracted Spanish braille for the Spanish (using UEB for punctuation, indicators, etc.). That's what I would do for a children's book that is in both languages; using different margins for English and Spanish text will help the reader understand the switch from one code to another.