First, it is interesting that you mentioned speaking to Lilith before going to bed and considering taking her on as a deity. Dreams often incorporate elements from our waking life and personal experiences, so this may have influenced the content of your dream.
The three knocks you heard before falling asleep may have also played a role in your dream. As you mentioned, some sources suggest that three knocks may be associated with the presence of a demon. However, it is important to keep in mind that dreams are highly personal and symbolic, and the meaning of the knocks may be unique to you and your experiences but the fact that you mention it in your post suggests you are in alignment with this demonic interpretation and, while it's hard to say conclusively, there may be an alignment with dark energy.
In your dream, you were tangled in your blanket and floating, with the sun shining through the blanket. This may symbolize a feeling of being trapped or constrained in some way, while also being exposed to light and warmth. The fact that the blanket was over your head in real life while you slept suggests that this may be a symbol of feeling overwhelmed or suffocated by something in your waking life.
The content of your dream suggests that you may be seeking protection and security, both physically and emotionally. Your request to Lilith for protection against males and negativity may reflect a desire for safety and a need to guard yourself against potential threats. Offering her your loyalty and an altar may symbolize a desire for a deeper connection to the higher powers and a sense of purpose or belonging. It's difficult to determine whether your yearning for a deeper connection is a desire to connect with energies associated with darkness or lightness.
In your dream, you sought the protection of Lilith and expressed a desire for a deeper connection with the divine. Lilith is often associated with dark feminine energy, and your request for protection against males and negativity could be interpreted as a desire to connect with darker energies for protection and empowerment.
On the other hand, the fact that the sun was shining through the blanket in your dream suggests a positive or hopeful aspect to your desire for connection. The symbolism of light is often associated with positivity, enlightenment, and growth. This could be interpreted as a desire to connect with lighter energies for spiritual fulfillment and growth.
In my opinion, this dream is exploring themes of power, protection, and spirituality. It may be helpful to reflect on your personal associations with Lilith, the symbolism of the blanket and the sun, and any other significant elements from the dream to gain a deeper understanding of its meaning for you.
Jungian active imagination could be a useful tool for exploring your personal associations with Lilith, the symbolism of the blanket, and the sun in your dream.
set aside some time in a quiet and comfortable space where you won't be disturbed. Begin by focusing on the symbols in your dream that stood out to you, such as Lilith, the blanket, and the sun. Try to immerse yourself in the sensory details of these symbols and let your imagination take you where it will.
You could then engage with the symbols by asking them questions or having conversations with them. For example, you could ask Lilith what she represents to you and what she might be trying to communicate through your dream. You could also explore the symbolism of the blanket and the sun and what they might represent in your personal experience.