Maybe you're doing it much more complex that actually is.
Most importantly: assert/retract should not be used for computing temporary relations in DB. Use them only to change knowledge - that is, well structured and meaningful relations that need to be persistent for the duration of the program.
For your task, try
friends_of(Person, Friends) :-
setof(Friend, (friendof(Person, Friend) ; friendof(Friend, Person)), Friends).
edit Of course, I don't understand why you need to do it so much more complicated... maybe you need to show you are able to issue modification to DB ? I fear you will discover that such problem (keeping a coherent db state) is much more difficult than foreseen, and learning to assert/retract useless relations will not help you much. Anyway...
friends(Friend, LL) :-
asserta(friendlist([])),
friends2(Friend),
retract(friendlist(LL)), !.
friends2(F) :-
( friendof(F, P) ; friendof(P, F) ),
retract(friendlist(L)),
assert(friendlist([P|L])),
fail.
friends2(_).
could work for you...