The previous sketch was filling flash for 29k and the new one for 23k.
Ah, that makes more sense.
(strstr(url_param, " HTTP"))[0] = 0;
This is not how I would NULL terminate url_param.
if (strlen(url_param))
{
int j = 0;
while (strlen(url_param))
{
The strlen() function does not return a boolean. It's better if you explicitly define if what and while what.
**********| THIS PART SEEMS TO HAVE SOME PROBLEM |**********************
//client.println("HTTP/1.1 200 OK");
//client.println("Content-Type: text/html");
//client.println();
client.println("{di:[{pin:2,v:0},{pin:3,v:1},{pin:4,v:1}]}");
*************************************************************
Aside from the fact that it won't even compile?
What problem? You are sending a literal string to the client instance. How is that causing the Arduino a problem?
Using the SD class requires a 512 character buffer. The Ethernet class needs some memory. The 500 character array, buffer, takes nearly a quarter of the available SRAM. The 100 character array, clientline, uses up a lot of the remaining memory. I'd hazard a guess that you are running out of memory.
There is still code you haven't posted. What does writeIO() do? What does decodeURLparam() do?