the please help me in caps lock, and the fact you created the question twice, made me don't want to help you. it's bad etiquete to write PLEASE HELP ME FOR THE LOVE OF THE GOOD, I AM DYING UNLESS YOU HELP ME WITH MY R4" please. don't do that.... you will get much more help if you be nice and cool...
1 yes it is illegal, depending on your country. but usually if you only use it for homebrew and play games you own its not "illegal" but even that is a gray area, but lets not discuss that ok?
2 yes, there is apps\homebrew for play movies music or see pictures, however they must be converted..
3 i don't understand why you think you would "code" it... you can "code" proggrams for it, you can make your own stuff, its called homebrew, but there is already plenty of stuff available, but be free to contribute if you know
http://gamebrew.org/wiki/List_of_DS_homebrew_applications
4 in varios places, usually online on websites that may be a bit shaddy, beucase usually they come from china, heres a thread i made about the shops
https://gbatemp.net/threads/i-bought-my-flashcart-from-thread.391734/
5 you put the games you want, you download them from websites i can't mention here because its "illegal" but you can either find online the games or make a copy of the games you have (if you have a original ds or ds lite)
6 depends on your preference...
do you want to play gba games? then you need a original ds or ds lite, theese are the cheapest
the ds lite (compared to the original ds) has better screens, and you can adjust the brightness, better battery, it weights less.. and its more durable IMO
the original DS some people say it fits much better on the hands\being more confortable and if you put a gba cartridge it doesn't stick out (search about gba ds lite on google and you will see what i mean)
if you want a big screen, get a dsi XL, it has bigger screens, or if you want DSI ware\DSI games..
or if you want something more new and not so old\outdated, get a N3ds XL it has bigger screens... its the most recent console, it does play ds games and 3ds games.. and lots of stuff
keep in mind the r4 card will only work on DS MODE. that means no DSI MODE games neither 3ds games (there are hybrid games that work on DSI MODE but can run under DS MODE in a r4)
7 isn't that the same question as number 5? you don't have to pay for them, its "illegal" downloads from websites that provide the roms, you put the games on a micro sd card (maximum is 32 gb if the card does support SDHC)
can't talk more about that because its against gbatemp rules
keep in mind, if you gonna get a r4. there are tons of different r4. if you get a N3ds or a DSI you must make sure the card will support the console last firmware, i advice you the only r4 you should purchase is this one:
http://nds-card.com/ProShow.asp?ProID=149
notice how the card looks like and the website printed on it "r4ids.cn"
only purcahse the r4 with a sticker\package like that card in the link. there are tons of clones\fakes etc. you want a card that you are sure to work on every console and isn't slow as hell
you can buy from that shop, but takes a month to arrive because it comes from china, but its a very reputable store...